org.fest.assertions
Class FloatAssert

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

public class FloatAssert
extends GenericAssert<FloatAssert,Float>
implements NumberAssert

Assertions for Floats and floats.

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

Author:
Yvonne Wang, Alex Ruiz, Ansgar Konermann

Nested Class Summary
static class FloatAssert.Delta
          Deprecated. use top-level class Delta instead. This class will be removed in version 2.0.
 
Field Summary
 
Fields inherited from class org.fest.assertions.GenericAssert
actual, myself
 
Constructor Summary
protected FloatAssert(float actual)
          Creates a new FloatAssert.
protected FloatAssert(Float actual)
          Creates a new FloatAssert.
 
Method Summary
static FloatAssert.Delta delta(float d)
          Deprecated. use method Delta.delta(double) instead. This method will be removed in version 2.0.
 FloatAssert isEqualTo(float expected)
          Verifies that the actual Float is equal to the given one.
 FloatAssert isEqualTo(float expected, Delta delta)
          Verifies that the actual Float is equal to the given one, within a positive delta.
 FloatAssert isEqualTo(Float expected, Delta delta)
          Verifies that the actual Float is equal to the given one, within a positive delta.
 FloatAssert isEqualTo(float expected, FloatAssert.Delta delta)
          Deprecated. use method isEqualTo(float, org.fest.assertions.Delta) instead. This method will be removed in version 2.0.
 FloatAssert isGreaterThan(float other)
          Verifies that the actual Float is greater than the given one.
 FloatAssert isGreaterThanOrEqualTo(float other)
          Verifies that the actual Float is greater or equal to the given one.
 FloatAssert isLessThan(float other)
          Verifies that the actual Float is less than the given one.
 FloatAssert isLessThanOrEqualTo(float other)
          Verifies that the actual Float is less or equal to the given one.
 FloatAssert isNaN()
          Verifies that the actual Float is equal to Float.NaN.
 FloatAssert isNegative()
          Verifies that the actual Float is negative.
 FloatAssert isNotEqualTo(float other)
          Verifies that the actual Float is not equal to the given one.
 FloatAssert isPositive()
          Verifies that the actual Float is positive.
 FloatAssert isZero()
          Verifies that the actual Float 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

FloatAssert

protected FloatAssert(float actual)
Creates a new FloatAssert.

Parameters:
actual - the actual value to verify.

FloatAssert

protected FloatAssert(Float actual)
Creates a new FloatAssert.

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

isEqualTo

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

isEqualTo

@Deprecated
public FloatAssert isEqualTo(float expected,
                                        FloatAssert.Delta delta)
Deprecated. use method isEqualTo(float, org.fest.assertions.Delta) instead. This method will be removed in version 2.0.

Verifies that the actual Float is equal to the given one, within a positive delta.

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

isEqualTo

public FloatAssert isEqualTo(float expected,
                             Delta delta)
Verifies that the actual Float is equal to the given one, within a positive delta.

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

isEqualTo

public FloatAssert isEqualTo(Float expected,
                             Delta delta)
Verifies that the actual Float is equal to the given one, within a positive delta.

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

isNotEqualTo

public FloatAssert isNotEqualTo(float other)
Verifies that the actual Float is not equal to the given one.

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

isGreaterThan

public FloatAssert isGreaterThan(float other)
Verifies that the actual Float is greater than the given one.

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

isLessThan

public FloatAssert isLessThan(float other)
Verifies that the actual Float is less than the given one.

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

isGreaterThanOrEqualTo

public FloatAssert isGreaterThanOrEqualTo(float other)
Verifies that the actual Float is greater or equal to the given one.

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

isLessThanOrEqualTo

public FloatAssert isLessThanOrEqualTo(float other)
Verifies that the actual Float is less or equal to the given one.

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

isNaN

public FloatAssert isNaN()
Verifies that the actual Float is equal to Float.NaN.

Returns:
this assertion object.
Throws:
AssertionError - if the actual Float is not equal to NaN.

isZero

public FloatAssert isZero()
Verifies that the actual Float is equal to zero.

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

isPositive

public FloatAssert isPositive()
Verifies that the actual Float is positive.

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

isNegative

public FloatAssert isNegative()
Verifies that the actual Float is negative.

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

delta

@Deprecated
public static FloatAssert.Delta delta(float d)
Deprecated. use method Delta.delta(double) instead. This method will be removed in version 2.0.

Creates a new holder for a delta value to be used in isEqualTo(float, org.fest.assertions.FloatAssert.Delta).

Parameters:
d - the delta value.
Returns:
a new delta value holder.


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