BigDecimals.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv BigDecimals |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public SELF | Returns: this assertion object.the expected scale value. expectedScale)Verifies the BigDecimal under test has the given scale. |
| public SELF | isBetween(BigDecimal
the start value (inclusive), expected not to be null. start, BigDecimal the end value (inclusive), expected not to be null. end)Overrides org. Implements org. |
| public SELF | Returns: this assertion object.the given number to compare the actual value to. expected, final Offset<BigDecimal> the given positive offset. offset)Implements org. |
| public SELF | Returns: this assertion object.the given number to compare the actual value to. expected, Percentage the given positive percentage. percentage)Implements org. |
| public SELF | Returns: this assertion object.the expected expected)BigDecimal passed as a StringOverrides org. Implements org. isEqualByComparingTo(BigDecimal) but
takes care of converting given String to BigDecimal.
|
| public SELF | Returns: this assertion object.the given number to compare the actual value to. expected)Same as |
| public SELF | Returns: this assertion object.the given value to compare the actual value to. other)Overrides org. Implements org. |
| public SELF | Returns: this assertion object.the given value to compare the actual value to. other)Overrides org. Implements org. |
| public SELF | isNegative()
Implements org. |
| public SELF | Returns: this assertion object.the given number to compare the actual value to. expected, final Offset<BigDecimal> the given positive offset. offset)Implements org. |
| public SELF | Returns: this assertion object.the given number to compare the actual value to. expected, Percentage the given positive percentage. percentage)Implements org. |
| public SELF | Returns: this assertion object.the notExpected)BigDecimal value passed as a String not to expect.Overrides org. Implements org. isNotEqualByComparingTo(BigDecimal) but
takes care of converting given String to BigDecimal.
|
| public SELF | isNotNegative()
Implements org. |
| public SELF | isNotPositive()
Implements org. |
| public SELF | isNotZero()
Implements org. |
| public SELF | isOne()
Implements org. |
| public SELF | isPositive()
Implements org. |
| public SELF | isStrictlyBetween(BigDecimal
the start value (exclusive), expected not to be null. start, BigDecimal the end value (exclusive), expected not to be null. end)Overrides org. Implements org. |
| public SELF | isZero()
Implements org. |
| public AbstractBigDecimalScaleAssert | Returns: AbstractBigDecimalScaleAssert built with theBigDecimal's scale.Returns an |
| public SELF | usingComparator(Comparator<? super BigDecimal>
the comparator to use for the incoming assertion checks. customComparator)Overrides org. Implements org. |
| public SELF | usingComparator(Comparator<? super BigDecimal>
the comparator to use for the incoming assertion checks. customComparator, String comparator description to be used in assertion error messages customComparatorDescription)Overrides org. Implements org. |
| public SELF | usingDefaultComparator()
Overrides org. Implements org. |
| bigDecimals | back to summary |
|---|---|
| pack-priv BigDecimals bigDecimals
| |
| AbstractBigDecimalAssert | back to summary |
|---|---|
| protected AbstractBigDecimalAssert(BigDecimal actual, Class<?> selfType) | |
| hasScaleOf | back to summary |
|---|---|
| public SELF hasScaleOf(int expectedScale) Verifies the BigDecimal under test has the given scale. Example:
| |
| isBetween | back to summary |
|---|---|
| public SELF isBetween(BigDecimal start, BigDecimal end) Overrides org. Implements org. Verifies that the actual value is in [start, end] range (start and end included). Example:
Note that comparison of BigDecimal is done by value without scale consideration, i.e 2.0 and 2.00 are
considered equal in value unlike BigDecimal#equals(Object).
| |
| isCloseTo | back to summary |
|---|---|
| public SELF isCloseTo(final BigDecimal expected, final Offset<BigDecimal> offset) Implements org. Verifies that the actual number is close to the given one within the given offset value. When abs(actual - expected) == offset value, the assertion:
Breaking change since 2.9.0/3.9.0: using Examples:
| |
| isCloseTo | back to summary |
|---|---|
| public SELF isCloseTo(BigDecimal expected, Percentage percentage) Implements org. Verifies that the actual number is close to the given one within the given percentage. Example with BigDecimal:
| |
| isEqualByComparingTo | back to summary |
|---|---|
| public SELF isEqualByComparingTo(String expected) Overrides org. Implements org. Same as Example:
| |
| isEqualTo | back to summary |
|---|---|
| public SELF isEqualTo(String expected) Same as Example:
| |
| isGreaterThanOrEqualTo | back to summary |
|---|---|
| public SELF isGreaterThanOrEqualTo(BigDecimal other) Overrides org. Implements org. Verifies that the actual value is greater than or equal to the given one. Example:
Note that comparison of BigDecimal is done by value without scale consideration, i.e 2.0 and 2.00 are
considered equal in value unlike BigDecimal#equals(Object).
| |
| isLessThanOrEqualTo | back to summary |
|---|---|
| public SELF isLessThanOrEqualTo(BigDecimal other) Overrides org. Implements org. Verifies that the actual value is less than or equal to the given one. Example:
Note that comparison of BigDecimal is done by value without scale consideration, i.e 2.0 and 2.00 are
considered equal in value unlike BigDecimal#equals(Object).
| |
| isNegative | back to summary |
|---|---|
| public SELF isNegative() Implements org. Doc from org. Verifies that the actual value is negative. Example:
Example:
| |
| isNotCloseTo | back to summary |
|---|---|
| public SELF isNotCloseTo(final BigDecimal expected, final Offset<BigDecimal> offset) Implements org. Verifies that the actual number is not close to the given one by less than the given offset. When abs(actual - expected) == offset value, the assertion:
Breaking change since 2.9.0/3.9.0: using Example:
| |
| isNotCloseTo | back to summary |
|---|---|
| public SELF isNotCloseTo(BigDecimal expected, Percentage percentage) Implements org. Verifies that the actual number is not close to the given one by the given percentage. Example with BigDecimal:
| |
| isNotEqualByComparingTo | back to summary |
|---|---|
| public SELF isNotEqualByComparingTo(String notExpected) Overrides org. Implements org. Same as Example:
| |
| isNotNegative | back to summary |
|---|---|
| public SELF isNotNegative() Implements org. Doc from org. Verifies that the actual value is non negative (positive or equal zero). Example:
Example:
| |
| isNotPositive | back to summary |
|---|---|
| public SELF isNotPositive() Implements org. Doc from org. Verifies that the actual value is non positive (negative or equal zero). Example:
Example:
| |
| isNotZero | back to summary |
|---|---|
| public SELF isNotZero() Implements org. Doc from org. Verifies that the actual value is not equal to zero. Example:
Example:
| |
| isOne | back to summary |
|---|---|
| public SELF isOne() Implements org. Doc from org. Verifies that the actual value is equal to one. Example:
Example:
| |
| isPositive | back to summary |
|---|---|
| public SELF isPositive() Implements org. Doc from org. Verifies that the actual value is positive. Example:
Example:
| |
| isStrictlyBetween | back to summary |
|---|---|
| public SELF isStrictlyBetween(BigDecimal start, BigDecimal end) Overrides org. Implements org. Verifies that the actual value is in ]start, end[ range (start excluded, end excluded). Example:
| |
| isZero | back to summary |
|---|---|
| public SELF isZero() Implements org. Doc from org. Verifies that the actual value is equal to zero. Example:
Example:
| |
| scale | back to summary |
|---|---|
| public AbstractBigDecimalScaleAssert Returns an
Once this method is called, the object under test is no longer the Example:
| |
| usingComparator | back to summary |
|---|---|
| public SELF usingComparator(Comparator<? super BigDecimal> customComparator) Overrides org. Implements org. Doc from org. Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks. The custom comparator is bound to assertion instance, meaning that if a new assertion instance is created, the default comparison strategy will be used. Examples :
| |
| usingComparator | back to summary |
|---|---|
| public SELF usingComparator(Comparator<? super BigDecimal> customComparator, String customComparatorDescription) Overrides org. Implements org. Doc from org. Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks. The custom comparator is bound to assertion instance, meaning that if a new assertion instance is created, the default comparison strategy will be used. Examples :
| |
| usingDefaultComparator | back to summary |
|---|---|
| public SELF usingDefaultComparator() Overrides org. Implements org. Doc from org. Revert to standard comparison for the incoming assertion checks.
This method should be used to disable a custom comparison strategy set by calling
| |