Package org.fest.assertions.internal
Class RealNumbers<NUMBER extends Comparable<NUMBER>>
java.lang.Object
org.fest.assertions.internal.Comparables
org.fest.assertions.internal.Numbers<NUMBER>
org.fest.assertions.internal.RealNumbers<NUMBER>
Base class of reusable assertions for real numbers (float and double).
- Author:
- Joel Costigliola
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
assertIsNaN
(AssertionInfo info, NUMBER actual) Verifies that the actual value is equal toNaN
.
It does not rely on the custom comparisonStrategy (if one is set).void
assertIsNotNaN
(AssertionInfo info, NUMBER actual) Verifies that the actual value is not equal toNaN
.protected abstract 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 abstract NUMBER
NaN()
Methods inherited from class org.fest.assertions.internal.Numbers
assertIsNegative, assertIsNotNegative, assertIsNotPositive, assertIsNotZero, assertIsPositive, assertIsZero, zero
Methods inherited from class org.fest.assertions.internal.Comparables
areEqual, assertEqual, assertEqualByComparison, assertGreaterThan, assertGreaterThanOrEqualTo, assertLessThan, assertLessThanOrEqualTo, assertNotEqual, assertNotEqualByComparison, assertNotNull, getComparator, instance
-
Constructor Details
-
RealNumbers
public RealNumbers() -
RealNumbers
-
-
Method Details
-
assertIsNaN
Verifies that the actual value is equal toNaN
.
It does not rely on the custom comparisonStrategy (if one is set).- Parameters:
info
- contains information about the assertion.actual
- the actual value.- Throws:
AssertionError
- if the actual value is not equal toNaN
.
-
NaN
-
assertIsNotNaN
Verifies that the actual value is not equal toNaN
.- Parameters:
info
- contains information about the assertion.actual
- the actual value.- Throws:
AssertionError
- if the actual value is equal toNaN
.
-
isEqualTo
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.- 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.
-