Class CurrencySubject


  • @API(status=MAINTAINED)
    public class CurrencySubject
    extends com.google.common.truth.Subject
    A Truth subject for Currency.
    Since:
    0.1.0
    See Also:
    Subject
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.google.common.truth.Subject

        com.google.common.truth.Subject.Factory<SubjectT extends com.google.common.truth.Subject,​ActualT extends Object>
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static CurrencySubject assertThat​(@Nullable Currency actual)
      Assert upon a currency.
      static com.google.common.truth.Subject.Factory<CurrencySubject,​Currency> currencies()  
      com.google.common.truth.StringSubject currencyCode()
      Assert further upon the currency code.
      com.google.common.truth.IntegerSubject defaultFractionDigits()
      Assert further upon the default fraction digits.
      com.google.common.truth.StringSubject displayName()
      Assert further upon the display name.
      com.google.common.truth.StringSubject displayName​(Locale locale)
      Assert further upon the display name.
      com.google.common.truth.IntegerSubject numericCode()
      Assert further upon the numeric currency code.
      com.google.common.truth.StringSubject symbol()
      Assert further upon the symbol of the currency.
      com.google.common.truth.StringSubject symbol​(Locale locale)
      Assert further upon the symbol of the currency.
      • Methods inherited from class com.google.common.truth.Subject

        actualCustomStringRepresentation, check, equals, failWithActual, failWithActual, failWithoutActual, hashCode, ignoreCheck, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs, toString
    • Method Detail

      • assertThat

        public static CurrencySubject assertThat​(@Nullable Currency actual)
        Assert upon a currency.
        Parameters:
        actual - the actual currency
        Returns:
        a new assertion subject
      • currencies

        public static com.google.common.truth.Subject.Factory<CurrencySubject,​Currency> currencies()
        Returns:
        a subject factory for asserting about currencies.
      • currencyCode

        public com.google.common.truth.StringSubject currencyCode()
        Assert further upon the currency code.
        Returns:
        a subject about the currency code of the currency
        Throws:
        AssertionError - if the actual is null
        See Also:
        Currency.getCurrencyCode()
      • displayName

        public com.google.common.truth.StringSubject displayName()
        Assert further upon the display name.
        Returns:
        a subject about the display name of the currency
        Throws:
        AssertionError - if the actual is null
        See Also:
        Currency.getDisplayName()
      • displayName

        public com.google.common.truth.StringSubject displayName​(Locale locale)
        Assert further upon the display name.
        Parameters:
        locale - the locale to fetch the display name for
        Returns:
        a subject about the display name of the currency
        Throws:
        AssertionError - if the actual is null
        See Also:
        Currency.getDisplayName(Locale)
      • numericCode

        public com.google.common.truth.IntegerSubject numericCode()
        Assert further upon the numeric currency code.
        Returns:
        a subject about the numeric code of the currency
        Throws:
        AssertionError - if the actual is null
        See Also:
        Currency.getNumericCode()
      • symbol

        public com.google.common.truth.StringSubject symbol()
        Assert further upon the symbol of the currency.
        Returns:
        a subject about the symbol of the currency
        Throws:
        AssertionError - if the actual is null
        See Also:
        Currency.getSymbol()
      • symbol

        public com.google.common.truth.StringSubject symbol​(Locale locale)
        Assert further upon the symbol of the currency.
        Parameters:
        locale - the locale to fetch the symbol for
        Returns:
        a subject about the symbol of the currency
        Throws:
        AssertionError - if the actual is null
        See Also:
        Currency.getSymbol(Locale)
      • defaultFractionDigits

        public com.google.common.truth.IntegerSubject defaultFractionDigits()
        Assert further upon the default fraction digits.
        Returns:
        a subject about the default fraction digits of the currency
        Throws:
        AssertionError - if the actual is null
        See Also:
        Currency.getDefaultFractionDigits()