org.assertj.core.internal
Class Floats

java.lang.Object
  extended by org.assertj.core.internal.Comparables
      extended by org.assertj.core.internal.Numbers<NUMBER>
          extended by org.assertj.core.internal.RealNumbers<Float>
              extended by org.assertj.core.internal.Floats

public class Floats
extends RealNumbers<Float>

Reusable assertions for Floats.

Author:
Alex Ruiz, Joel Costigliola, Mikhail Mazursky

Constructor Summary
Floats(ComparisonStrategy comparisonStrategy)
           
 
Method Summary
 void assertEqual(AssertionInfo info, Float actual, Float expected, Offset<Float> offset)
          Verifies that two floats are equal within a positive offset.
It does not rely on the custom comparisonStrategy (if one is set) because using an offset is already a specific comparison strategy.
 void assertIsCloseTo(AssertionInfo info, Float actual, Float expected, Offset<Float> offset)
           
static Floats instance()
          Returns the singleton instance of this class based on StandardComparisonStrategy.
protected  boolean isEqualTo(Float actual, Float expected, Offset<?> offset)
          Returns true if the two floats parameter are equal within a positive offset, false otherwise.
It does not rely on the custom comparisonStrategy (if one is set) because using an offset is already a specific comparison strategy.
protected  Float NaN()
           
protected  Float zero()
           
 
Methods inherited from class org.assertj.core.internal.RealNumbers
assertIsNaN, assertIsNotNaN
 
Methods inherited from class org.assertj.core.internal.Numbers
assertIsBetween, assertIsNegative, assertIsNotNegative, assertIsNotPositive, assertIsNotZero, assertIsPositive, assertIsStrictlyBetween, assertIsZero
 
Methods inherited from class org.assertj.core.internal.Comparables
areEqual, assertEqual, assertEqualByComparison, assertGreaterThan, assertGreaterThanOrEqualTo, assertIsBetween, assertLessThan, assertLessThanOrEqualTo, assertNotEqual, assertNotEqualByComparison, assertNotNull, getComparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Floats

public Floats(ComparisonStrategy comparisonStrategy)
Method Detail

instance

public static Floats instance()
Returns the singleton instance of this class based on StandardComparisonStrategy.

Returns:
the singleton instance of this class based on StandardComparisonStrategy.

zero

protected Float zero()
Specified by:
zero in class Numbers<Float>

NaN

protected Float NaN()
Specified by:
NaN in class RealNumbers<Float>

isEqualTo

protected boolean isEqualTo(Float actual,
                            Float expected,
                            Offset<?> offset)
Description copied from class: RealNumbers
Returns true if the two floats parameter are equal within a positive offset, false otherwise.
It does not rely on the custom comparisonStrategy (if one is set) because using an offset is already a specific comparison strategy.

Specified by:
isEqualTo in class RealNumbers<Float>
Parameters:
actual - the actual value.
expected - the expected value.
offset - the given positive offset.
Returns:
true if the two floats parameter are equal within a positive offset, false otherwise.

assertIsCloseTo

public void assertIsCloseTo(AssertionInfo info,
                            Float actual,
                            Float expected,
                            Offset<Float> offset)

assertEqual

public void assertEqual(AssertionInfo info,
                        Float actual,
                        Float expected,
                        Offset<Float> offset)
Verifies that two floats are equal within a positive offset.
It does not rely on the custom comparisonStrategy (if one is set) because using an offset is already a specific comparison strategy.

Parameters:
info - contains information about the assertion.
actual - the actual value.
expected - the expected value.
offset - the given positive offset.
Throws:
NullPointerException - if the given offset is null.
AssertionError - if the actual value is not equal to the expected one.


Copyright © 2013–2015 AssertJ. All rights reserved.