org.fest.assertions
Class IntAssert

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

public class IntAssert
extends GenericAssert<IntAssert,Integer>
implements NumberAssert

Assertions for Integers and ints.

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

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

Field Summary
 
Fields inherited from class org.fest.assertions.GenericAssert
actual, myself
 
Constructor Summary
protected IntAssert(int actual)
          Creates a new IntAssert.
protected IntAssert(Integer actual)
          Creates a new IntAssert.
 
Method Summary
 IntAssert isEqualTo(int expected)
          Verifies that the actual Integer is equal to the given one.
 IntAssert isGreaterThan(int other)
          Verifies that the actual Integer is greater than the given one.
 IntAssert isGreaterThanOrEqualTo(int other)
          Verifies that the actual Integer is greater or equal to the given one.
 IntAssert isLessThan(int other)
          Verifies that the actual Integer is less than the given one.
 IntAssert isLessThanOrEqualTo(int other)
          Verifies that the actual Integer is less or equal to the given one.
 IntAssert isNegative()
          Verifies that the actual Integer is negative.
 IntAssert isNotEqualTo(int other)
          Verifies that the actual Integer is not equal to the given one.
 IntAssert isPositive()
          Verifies that the actual Integer is positive.
 IntAssert isZero()
          Verifies that the actual Integer 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

IntAssert

protected IntAssert(int actual)
Creates a new IntAssert.

Parameters:
actual - the actual value to verify.

IntAssert

protected IntAssert(Integer actual)
Creates a new IntAssert.

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

isEqualTo

public IntAssert isEqualTo(int expected)
Verifies that the actual Integer 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 Integer is not equal to the given one.

isNotEqualTo

public IntAssert isNotEqualTo(int other)
Verifies that the actual Integer is not equal to the given one.

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

isGreaterThan

public IntAssert isGreaterThan(int other)
Verifies that the actual Integer is greater than the given one.

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

isLessThan

public IntAssert isLessThan(int other)
Verifies that the actual Integer is less than the given one.

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

isGreaterThanOrEqualTo

public IntAssert isGreaterThanOrEqualTo(int other)
Verifies that the actual Integer is greater or equal to the given one.

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

isLessThanOrEqualTo

public IntAssert isLessThanOrEqualTo(int other)
Verifies that the actual Integer is less or equal to the given one.

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

isZero

public IntAssert isZero()
Verifies that the actual Integer is equal to zero.

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

isPositive

public IntAssert isPositive()
Verifies that the actual Integer is positive.

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

isNegative

public IntAssert isNegative()
Verifies that the actual Integer is negative.

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


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