Class BigDecimalSubject


public final class BigDecimalSubject extends ComparableSubject<BigDecimal>
Wrapper over BigDecimalSubject.

Since:
1.0
Author:
Iulian Andrei (iulian.andrei@qaitsolutions.com)
  • Constructor Details

    • BigDecimalSubject

      public BigDecimalSubject(BigDecimal actual, String message)
      Constructor for regular assertions.

      Parameters:
      actual - Current value to be verified.
      message - Description of the assertion.
    • BigDecimalSubject

      public BigDecimalSubject(BigDecimal actual, String message, ErrorTracker tracker)
      Constructor for soft assertions.

      Parameters:
      actual - Current value to be verified.
      message - Description of the assertion.
      tracker - Entity which allows keeping track of existing errors.
  • Method Details

    • isEqualToIgnoringScale

      public void isEqualToIgnoringScale(BigDecimal expected)
      Fails if the subject's value is not equal to the value of the given BigDecimal. Wrapper over BigDecimalSubject.isEqualToIgnoringScale(BigDecimal).

      Parameters:
      expected - Value to be verified against.
    • isEqualToIgnoringScale

      public void isEqualToIgnoringScale(String expected)
      Fails if the subject's value is not equal to the value of the BigDecimal created from the expected string. Wrapper over BigDecimalSubject.isEqualToIgnoringScale(String).

      Parameters:
      expected - Value to be verified against.
    • isEqualToIgnoringScale

      public void isEqualToIgnoringScale(long expected)
      Fails if the subject's value is not equal to the value of the BigDecimal created from the expected long. Wrapper over BigDecimalSubject.isEqualToIgnoringScale(long) )}.

      Parameters:
      expected - Value to be verified against.
    • isEqualTo

      public void isEqualTo(@Nullable Object expected)
      Description copied from class: Subject
      Fails if the subject is not equal to the given object. Wrapper over Subject.isEqualTo(Object).

      Overrides:
      isEqualTo in class Subject
      Parameters:
      expected - Value to be checked against.
    • isEquivalentAccordingToCompareTo

      public void isEquivalentAccordingToCompareTo(BigDecimal expected)
      Description copied from class: ComparableSubject
      Checks that the subject is equivalent to other according to Comparable.compareTo(T). Wrapper over ComparableSubject.isEquivalentAccordingToCompareTo(Comparable).

      Overrides:
      isEquivalentAccordingToCompareTo in class ComparableSubject<BigDecimal>
      Parameters:
      expected - Value to be verified against.