public class Assert extends Object
Constructor and Description |
---|
Assert() |
Modifier and Type | Method and Description |
---|---|
static void |
equals(Object expectedValue,
Object actualValue)
Throws an
AssertionFailedException if the given objects are
not equal, according to the equals method. |
static void |
equals(Object expectedValue,
Object actualValue,
String message)
Throws an
AssertionFailedException with the given message if
the given objects are not equal, according to the equals
method. |
static void |
isTrue(boolean assertion)
Throws an
AssertionFailedException if the given assertion is
not true. |
static void |
isTrue(boolean assertion,
String message)
Throws an
AssertionFailedException with the given message if
the given assertion is not true. |
static void |
shouldNeverReachHere()
Always throws an
AssertionFailedException . |
static void |
shouldNeverReachHere(String message)
Always throws an
AssertionFailedException with the given
message. |
public static void isTrue(boolean assertion)
AssertionFailedException
if the given assertion is
not true.assertion
- a condition that is supposed to be trueAssertionFailedException
- if the condition is falsepublic static void isTrue(boolean assertion, String message)
AssertionFailedException
with the given message if
the given assertion is not true.assertion
- a condition that is supposed to be truemessage
- a description of the assertionAssertionFailedException
- if the condition is falsepublic static void equals(Object expectedValue, Object actualValue)
AssertionFailedException
if the given objects are
not equal, according to the equals
method.expectedValue
- the correct valueactualValue
- the value being checkedAssertionFailedException
- if the two objects are not equalpublic static void equals(Object expectedValue, Object actualValue, String message)
AssertionFailedException
with the given message if
the given objects are not equal, according to the equals
method.expectedValue
- the correct valueactualValue
- the value being checkedmessage
- a description of the assertionAssertionFailedException
- if the two objects are not equalpublic static void shouldNeverReachHere()
AssertionFailedException
.AssertionFailedException
- thrown alwayspublic static void shouldNeverReachHere(String message)
AssertionFailedException
with the given
message.message
- a description of the assertionAssertionFailedException
- thrown alwaysCopyright © 2021. All rights reserved.