public final class BigDecimalSubject extends ComparableSubject<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 ). |
isAtLeast, isAtMost, isGreaterThan, isIn, isLessThan, isNotIn
actualCustomStringRepresentation, check, equals, failWithActual, failWithActual, failWithoutActual, hashCode, ignoreCheck, isAnyOf, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs, 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.
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<BigDecimal>
Copyright © 2019. All rights reserved.