public class BigDecimalAssert extends AbstractUnevenComparableAssert<BigDecimalAssert,BigDecimal> implements NumberAssert<BigDecimal>
BigDecimal
s.
To create an instance of this class, invoke
.
Assertions.assertThat(BigDecimal)
actual, myself
Modifier | Constructor and Description |
---|---|
protected |
BigDecimalAssert(BigDecimal actual) |
Modifier and Type | Method and Description |
---|---|
BigDecimalAssert |
isEqualByComparingTo(String expected)
Same as
isEqualByComparingTo(BigDecimal) but takes
care of converting given String to BigDecimal for you. |
BigDecimalAssert |
isEqualTo(String expected)
Same as
isEqualTo(BigDecimal) but takes care of converting given String to
BigDecimal for you. |
BigDecimalAssert |
isNegative()
Verifies that the actual value is negative.
|
BigDecimalAssert |
isNotNegative()
Verifies that the actual value is non negative (positive or equal zero).
|
BigDecimalAssert |
isNotPositive()
Verifies that the actual value is non positive (negative or equal zero).
|
BigDecimalAssert |
isNotZero()
Verifies that the actual value is not equal to zero.
|
BigDecimalAssert |
isPositive()
Verifies that the actual value is positive.
|
BigDecimalAssert |
isZero()
Verifies that the actual value is equal to zero.
|
BigDecimalAssert |
usingComparator(Comparator<? super BigDecimal> customComparator)
Use given custom comparator instead of relying on actual type A equals method for incoming assertion checks.
|
BigDecimalAssert |
usingDefaultComparator()
Revert to standard comparison for incoming assertion checks.
|
isEqualByComparingTo, isNotEqualByComparingTo
isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo
as, as, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, getWritableAssertionInfo, has, hashCode, hasSameClassAs, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, overridingErrorMessage
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo
protected BigDecimalAssert(BigDecimal actual)
public BigDecimalAssert isZero()
isZero
in interface NumberAssert<BigDecimal>
public BigDecimalAssert isNotZero()
isNotZero
in interface NumberAssert<BigDecimal>
public BigDecimalAssert isPositive()
isPositive
in interface NumberAssert<BigDecimal>
public BigDecimalAssert isNegative()
isNegative
in interface NumberAssert<BigDecimal>
public BigDecimalAssert isNotPositive()
isNotPositive
in interface NumberAssert<BigDecimal>
this
assertion object.public BigDecimalAssert isNotNegative()
isNotNegative
in interface NumberAssert<BigDecimal>
this
assertion object.public BigDecimalAssert isEqualTo(String expected)
isEqualTo(BigDecimal)
but takes care of converting given String to
BigDecimal
for you.public BigDecimalAssert isEqualByComparingTo(String expected)
isEqualByComparingTo(BigDecimal)
but takes
care of converting given String to BigDecimal
for you.public BigDecimalAssert usingComparator(Comparator<? super BigDecimal> customComparator)
AbstractAssert
Custom comparator is bound to assertion instance, meaning that if a new assertion is created, it will use default comparison strategy.
Examples :
// frodo and sam are instances of Character with Hobbit race (obviously :). // raceComparator implements Comparator<Character> assertThat(frodo).usingComparator(raceComparator).isEqualTo(sam);
usingComparator
in interface Assert<BigDecimalAssert,BigDecimal>
usingComparator
in class AbstractComparableAssert<BigDecimalAssert,BigDecimal>
customComparator
- the comparator to use for incoming assertion checks.this
assertion object.public BigDecimalAssert usingDefaultComparator()
AbstractAssert
This method should be used to disable a custom comparison strategy set by calling Assert.usingComparator(Comparator)
.
usingDefaultComparator
in interface Assert<BigDecimalAssert,BigDecimal>
usingDefaultComparator
in class AbstractComparableAssert<BigDecimalAssert,BigDecimal>
this
assertion object.Copyright © 2007–2014. All rights reserved.