Package org.assertj.core.internal
Class RealNumbers<NUMBER extends Number & Comparable<NUMBER>>
java.lang.Object
org.assertj.core.internal.Comparables
org.assertj.core.internal.Numbers<NUMBER>
org.assertj.core.internal.RealNumbers<NUMBER>
public abstract class RealNumbers<NUMBER extends Number & Comparable<NUMBER>>
extends Numbers<NUMBER>
Base class of reusable assertions for real numbers (float and double).
-
Field Summary
Fields inherited from class org.assertj.core.internal.Comparables
comparisonStrategy, failures -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassertEqual(AssertionInfo info, NUMBER actual, NUMBER expected, Offset<NUMBER> offset) Verifies that two real numbers 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.voidassertIsNaN(AssertionInfo info, NUMBER actual) Verifies that the actual value is equal toNaN.
It does not rely on the custom comparisonStrategy (if one is set).voidassertIsNotNaN(AssertionInfo info, NUMBER actual) Verifies that the actual value is not equal toNaN.protected booleanisGreaterThan(NUMBER value, NUMBER other) protected abstract NUMBERNaN()Methods inherited from class org.assertj.core.internal.Numbers
absDiff, assertIsBetween, assertIsCloseTo, assertIsCloseToPercentage, assertIsNegative, assertIsNotCloseTo, assertIsNotCloseToPercentage, assertIsNotNegative, assertIsNotPositive, assertIsNotZero, assertIsOne, assertIsPositive, assertIsStrictlyBetween, assertIsZero, one, zeroMethods inherited from class org.assertj.core.internal.Comparables
areEqual, assertEqual, assertEqualByComparison, assertGreaterThan, assertGreaterThanOrEqualTo, assertIsBetween, assertLessThan, assertLessThanOrEqualTo, assertNotEqual, assertNotEqualByComparison, assertNotNull, getComparator, instance, resetFailures, setFailures
-
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
-
assertEqual
Verifies that two real numbers 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 isnull.AssertionError- if the actual value is not equal to the expected one.
-
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.
-
isGreaterThan
- Specified by:
isGreaterThanin classNumbers<NUMBER extends Number & Comparable<NUMBER>>
-