Enum Class AssertionFailedErrors
- All Implemented Interfaces:
Serializable
,Comparable<AssertionFailedErrors>
,Constable
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)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe error you get when an assertFalse fails -expected: <false> but was: <true>
The error you get when an assertNotNull fails -expected: not <null>
The error you get when an assertTrue fails -expected: <true> but was: <false>
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
AssertionFailedErrors
(String error) Creates a new Assertion Failed Error with the given error string -
Method Summary
Modifier and TypeMethodDescriptionstatic String
buildAssertError
(Object expected, Object actual) Builds an Assertion Failed Error string of the form:expected: <expected> but was: <actual>
static String
buildAssertErrorNot
(Object expectedNot) Builds an Assertion Failed Error string of the form:expected: not <value>
toString()
static AssertionFailedErrors
Returns the enum constant of this class with the specified name.static AssertionFailedErrors[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ASSERT_TRUE_ERROR
The error you get when an assertTrue fails -expected: <true> but was: <false>
-
ASSERT_FALSE_ERROR
The error you get when an assertFalse fails -expected: <false> but was: <true>
-
ASSERT_NOT_NULL_ERROR
The error you get when an assertNotNull fails -expected: not <null>
-
-
Field Details
-
error
The error string
-
-
Constructor Details
-
AssertionFailedErrors
Creates a new Assertion Failed Error with the given error string- Parameters:
error
- The error string
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
buildAssertErrorNot
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
Builds an Assertion Failed Error string of the form:expected: <expected> but was: <actual>
- Parameters:
expected
- The value we're expectingactual
- The actual value- Returns:
- A string representing an Assertion Failed Error string
-
toString
- Overrides:
toString
in classEnum<AssertionFailedErrors>
- Returns:
- The error string
-