Enum Class AssertionFailedErrors

java.lang.Object
java.lang.Enum<AssertionFailedErrors>
com.github.tadukoo.junit.constant.AssertionFailedErrors
All Implemented Interfaces:
Serializable, Comparable<AssertionFailedErrors>, Constable

public enum AssertionFailedErrors extends Enum<AssertionFailedErrors>
Assertion Failed Errors contains helper methods for creating Assertion Failed Error messages as well as several common error messages.
Version:
Alpha v.0.1
Author:
Logan Ferree (Tadukoo)
  • Enum Constant Details

    • ASSERT_TRUE_ERROR

      public static final AssertionFailedErrors ASSERT_TRUE_ERROR
      The error you get when an assertTrue fails - expected: <true> but was: <false>
    • ASSERT_FALSE_ERROR

      public static final AssertionFailedErrors ASSERT_FALSE_ERROR
      The error you get when an assertFalse fails - expected: <false> but was: <true>
    • ASSERT_NOT_NULL_ERROR

      public static final AssertionFailedErrors ASSERT_NOT_NULL_ERROR
      The error you get when an assertNotNull fails - expected: not <null>
  • Field Details

    • error

      private final String error
      The error string
  • Constructor Details

    • AssertionFailedErrors

      private AssertionFailedErrors(String error)
      Creates a new Assertion Failed Error with the given error string
      Parameters:
      error - The error string
  • Method Details

    • values

      public static AssertionFailedErrors[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AssertionFailedErrors valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • buildAssertErrorNot

      public static String buildAssertErrorNot(Object expectedNot)
      Builds an Assertion Failed Error string of the form: expected: not <value>
      Parameters:
      expectedNot - The value we're expecting to be false
      Returns:
      A string representing an Assertion Failed Error string
    • buildAssertError

      public static String buildAssertError(Object expected, Object actual)
      Builds an Assertion Failed Error string of the form: expected: <expected> but was: <actual>
      Parameters:
      expected - The value we're expecting
      actual - The actual value
      Returns:
      A string representing an Assertion Failed Error string
    • toString

      public String toString()
      Overrides:
      toString in class Enum<AssertionFailedErrors>
      Returns:
      The error string