org.fest.assertions.internal
Class Doubles
java.lang.Object
org.fest.assertions.internal.Comparables
org.fest.assertions.internal.Numbers<NUMBER>
org.fest.assertions.internal.RealNumbers<Double>
org.fest.assertions.internal.Doubles
public class Doubles
- extends RealNumbers<Double>
Reusable assertions for Double
s.
- Author:
- Alex Ruiz, Joel Costigliola
Constructor Summary |
Doubles(org.fest.util.ComparisonStrategy comparisonStrategy)
|
Methods inherited from class org.fest.assertions.internal.Comparables |
areEqual, assertEqual, assertEqualByComparison, assertGreaterThan, assertGreaterThanOrEqualTo, assertLessThan, assertLessThanOrEqualTo, assertNotEqual, assertNotEqualByComparison, assertNotNull, getComparator |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Doubles
public Doubles(org.fest.util.ComparisonStrategy comparisonStrategy)
instance
public static Doubles instance()
- Returns the singleton instance of this class based on
StandardComparisonStrategy
.
- Returns:
- the singleton instance of this class based on
StandardComparisonStrategy
.
zero
protected Double zero()
- Specified by:
zero
in class Numbers<Double>
NaN
protected Double NaN()
- Specified by:
NaN
in class RealNumbers<Double>
assertEqual
public void assertEqual(AssertionInfo info,
Double actual,
Double expected,
Offset<Double> 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 null
.
AssertionError
- if the actual value is not equal to the expected one.
isEqualTo
protected boolean isEqualTo(Double actual,
Double 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<Double>
- 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.
Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.