org.fest.assertions
Class LongAssert

java.lang.Object
  extended by org.fest.assertions.Assert
      extended by org.fest.assertions.GenericAssert<LongAssert,Long>
          extended by org.fest.assertions.LongAssert
All Implemented Interfaces:
NumberAssert

public class LongAssert
extends GenericAssert<LongAssert,Long>
implements NumberAssert

Assertions for Longs and longs.

To create a new instance of this class invoke either Assertions.assertThat(Long) or Assertions.assertThat(long).

Author:
Yvonne Wang, David DIDIER, Ansgar Konermann, Alex Ruiz

Field Summary
 
Fields inherited from class org.fest.assertions.GenericAssert
actual, myself
 
Constructor Summary
protected LongAssert(long actual)
          Creates a new LongAssert.
protected LongAssert(Long actual)
          Creates a new LongAssert.
 
Method Summary
 LongAssert isEqualTo(long expected)
          Verifies that the actual Long is equal to the given one.
 LongAssert isGreaterThan(long other)
          Verifies that the actual Long is greater than the given one.
 LongAssert isGreaterThanOrEqualTo(long other)
          Verifies that the actual Long is greater or equal to the given one.
 LongAssert isLessThan(long other)
          Verifies that the actual Long is less than the given one.
 LongAssert isLessThanOrEqualTo(long other)
          Verifies that the actual Long is less or equal to the given one.
 LongAssert isNegative()
          Verifies that the actual Long is negative.
 LongAssert isNotEqualTo(long other)
          Verifies that the actual Long is not equal to the given one.
 LongAssert isPositive()
          Verifies that the actual Long is positive.
 LongAssert isZero()
          Verifies that the actual Long is equal to zero.
 
Methods inherited from class org.fest.assertions.GenericAssert
as, as, describedAs, describedAs, doesNotSatisfy, is, isEqualTo, isIn, isIn, isNot, isNotEqualTo, isNotIn, isNotIn, isNotNull, isNotSameAs, isNull, isSameAs, overridingErrorMessage, satisfies
 
Methods inherited from class org.fest.assertions.Assert
customErrorMessage, description, description, description, equals, fail, fail, failIfCustomMessageIsSet, failIfCustomMessageIsSet, failure, formattedErrorMessage, hashCode, rawDescription, replaceDefaultErrorMessagesWith
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongAssert

protected LongAssert(long actual)
Creates a new LongAssert.

Parameters:
actual - the actual value to verify.

LongAssert

protected LongAssert(Long actual)
Creates a new LongAssert.

Parameters:
actual - the actual value to verify.
Method Detail

isEqualTo

public LongAssert isEqualTo(long expected)
Verifies that the actual Long is equal to the given one.

Parameters:
expected - the value to compare the actual one to.
Returns:
this assertion object.
Throws:
AssertionError - if the actual Long is not equal to the given one.

isNotEqualTo

public LongAssert isNotEqualTo(long other)
Verifies that the actual Long is not equal to the given one.

Parameters:
other - the given value.
Returns:
this assertion object.
Throws:
AssertionError - if the actual Long is equal to the given one.

isGreaterThan

public LongAssert isGreaterThan(long other)
Verifies that the actual Long is greater than the given one.

Parameters:
other - the given value.
Returns:
this assertion object.
Throws:
AssertionError - if the actual Long is not greater than the given one.

isLessThan

public LongAssert isLessThan(long other)
Verifies that the actual Long is less than the given one.

Parameters:
other - the given value.
Returns:
this assertion object.
Throws:
AssertionError - if the actual Long is not less than the given one.

isGreaterThanOrEqualTo

public LongAssert isGreaterThanOrEqualTo(long other)
Verifies that the actual Long is greater or equal to the given one.

Parameters:
other - the given value.
Returns:
this assertion object.
Throws:
AssertionError - if the actual Long is not greater than or equal to the given one.

isLessThanOrEqualTo

public LongAssert isLessThanOrEqualTo(long other)
Verifies that the actual Long is less or equal to the given one.

Parameters:
other - the given value.
Returns:
this assertion object.
Throws:
AssertionError - if the actual Long is not less than or equal to the given one.

isZero

public LongAssert isZero()
Verifies that the actual Long is equal to zero.

Specified by:
isZero in interface NumberAssert
Returns:
this assertion object.
Throws:
AssertionError - if the actual Long is not equal to zero.

isPositive

public LongAssert isPositive()
Verifies that the actual Long is positive.

Specified by:
isPositive in interface NumberAssert
Returns:
this assertion object.
Throws:
AssertionError - if the actual Long is not positive.

isNegative

public LongAssert isNegative()
Verifies that the actual Long is negative.

Specified by:
isNegative in interface NumberAssert
Returns:
this assertion object.
Throws:
AssertionError - if the actual Long is not negative.


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.