public class Floats extends RealNumbers<Float>
Float
s.Constructor and Description |
---|
Floats(ComparisonStrategy comparisonStrategy) |
Modifier and Type | Method and Description |
---|---|
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)
Asserts that the actual value is close to the 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() |
assertIsNaN, assertIsNotNaN
absDiff, assertIsBetween, assertIsCloseToPercentage, assertIsNegative, assertIsNotNegative, assertIsNotPositive, assertIsNotZero, assertIsPositive, assertIsStrictlyBetween, assertIsZero, isCloseToPercentageCommonChecks
areEqual, assertEqual, assertEqualByComparison, assertGreaterThan, assertGreaterThanOrEqualTo, assertIsBetween, assertLessThan, assertLessThanOrEqualTo, assertNotEqual, assertNotEqualByComparison, assertNotNull, getComparator
public Floats(ComparisonStrategy comparisonStrategy)
public static Floats instance()
StandardComparisonStrategy
.StandardComparisonStrategy
.protected Float NaN()
NaN
in class RealNumbers<Float>
protected boolean isEqualTo(Float actual, Float expected, Offset<?> offset)
RealNumbers
isEqualTo
in class RealNumbers<Float>
actual
- the actual value.expected
- the expected value.offset
- the given positive offset.public void assertIsCloseTo(AssertionInfo info, Float actual, Float expected, Offset<Float> offset)
Numbers
assertIsCloseTo
in class Numbers<Float>
info
- contains information about the assertion.actual
- the actual value.expected
- the expected value.offset
- the given positive offset.public void assertEqual(AssertionInfo info, Float actual, Float expected, Offset<Float> offset)
info
- contains information about the assertion.actual
- the actual value.expected
- the expected value.offset
- the given positive offset.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.