Package org.fest.assertions.internal
Class Floats
java.lang.Object
Reusable assertions for
Float
s.- Author:
- Alex Ruiz, Joel Costigliola
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.static Floats
instance()
Returns the singleton instance of this class based onStandardComparisonStrategy
.protected boolean
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.fest.assertions.internal.RealNumbers
assertIsNaN, assertIsNotNaN
Methods inherited from class org.fest.assertions.internal.Numbers
assertIsNegative, assertIsNotNegative, assertIsNotPositive, assertIsNotZero, assertIsPositive, assertIsZero
Methods inherited from class org.fest.assertions.internal.Comparables
areEqual, assertEqual, assertEqualByComparison, assertGreaterThan, assertGreaterThanOrEqualTo, assertLessThan, assertLessThanOrEqualTo, assertNotEqual, assertNotEqualByComparison, assertNotNull, getComparator
-
Constructor Details
-
Floats
-
-
Method Details
-
instance
Returns the singleton instance of this class based onStandardComparisonStrategy
.- Returns:
- the singleton instance of this class based on
StandardComparisonStrategy
.
-
zero
-
NaN
- Specified by:
NaN
in classRealNumbers<Float>
-
isEqualTo
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 classRealNumbers<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.
-
assertEqual
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 isnull
.AssertionError
- if the actual value is not equal to the expected one.
-