public final class BigDecimalSubject extends ComparableSubject<BigDecimalSubject,BigDecimal>
BigDecimal
typed subjects.Modifier and Type | Method and Description |
---|---|
void |
isEqualTo(Object expected)
Fails if the subject's value and scale is not equal to the given
BigDecimal . |
void |
isEqualToIgnoringScale(BigDecimal expected)
Fails if the subject's value is not equal to the value of the given
BigDecimal . |
void |
isEqualToIgnoringScale(long expected)
Fails if the subject's value is not equal to the value of the
BigDecimal created from
the expected long (i.e., fails if actual.comparesTo(new BigDecimal(expected)) !=
0 ). |
void |
isEqualToIgnoringScale(String expected)
Fails if the subject's value is not equal to the value of the
BigDecimal created from
the expected string (i.e., fails if actual.comparesTo(new BigDecimal(expected)) != 0 ). |
void |
isEquivalentAccordingToCompareTo(BigDecimal expected)
Fails if the subject is not equivalent to the given value according to
Comparable.compareTo(T) , (i.e., fails if a.comparesTo(b) != 0 ). |
comparesEqualTo, isAtLeast, isAtMost, isGreaterThan, isIn, isLessThan, isNotIn
actual, actualAsString, actualCustomStringRepresentation, check, check, equals, fail, fail, fail, failComparing, failComparing, failWithActual, failWithActual, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutActual, failWithoutSubject, failWithRawMessage, failWithRawMessageAndCause, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, named, toString
public void isEqualToIgnoringScale(BigDecimal expected)
BigDecimal
. (i.e.,
fails if actual.comparesTo(expected) != 0
).
Note: The scale of the BigDecimal is ignored. If you want to compare the values and
the scales, use isEqualTo(Object)
.
public void isEqualToIgnoringScale(String expected)
BigDecimal
created from
the expected string (i.e., fails if actual.comparesTo(new BigDecimal(expected)) != 0
).
Note: The scale of the BigDecimal is ignored. If you want to compare the values and
the scales, use isEqualTo(Object)
.
public void isEqualToIgnoringScale(long expected)
BigDecimal
created from
the expected long
(i.e., fails if actual.comparesTo(new BigDecimal(expected)) !=
0
).
Note: The scale of the BigDecimal is ignored. If you want to compare the values and
the scales, use isEqualTo(Object)
.
public void isEqualTo(@NullableDecl Object expected)
BigDecimal
.
Note: If you only want to compare the values of the BigDecimals and not their scales,
use isEqualToIgnoringScale(BigDecimal)
instead.
isEqualTo
in class Subject<BigDecimalSubject,BigDecimal>
public void isEquivalentAccordingToCompareTo(BigDecimal expected)
Comparable.compareTo(T)
, (i.e., fails if a.comparesTo(b) != 0
). This method behaves
identically to (the more clearly named) isEqualToIgnoringScale(BigDecimal)
.
Note: Do not use this method for checking object equality. Instead, use isEqualTo(Object)
.
isEquivalentAccordingToCompareTo
in class ComparableSubject<BigDecimalSubject,BigDecimal>
Copyright © 2018. All rights reserved.