|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.assertions.error.ShouldBeEqual
public class ShouldBeEqual
Creates an
indicating that an assertion that verifies that two objects are equal
failed.
AssertionError
The built AssertionError
's message differentiates actual
and expected
description if their
string representation are the same (e.g. 42 float and 42 double). It also mentions the comparator in case of a custom
comparator is used (instead of equals method).
Field Summary | |
---|---|
protected Object |
actual
|
protected Object |
expected
|
Method Summary | |
---|---|
boolean |
equals(Object o)
|
int |
hashCode()
|
AssertionError |
newAssertionError(Description description)
Creates an indicating that an assertion that verifies that two objects are
equal failed. |
static AssertionErrorFactory |
shouldBeEqual(Object actual,
Object expected)
Creates a new . |
static AssertionErrorFactory |
shouldBeEqual(Object actual,
Object expected,
org.fest.util.ComparisonStrategy comparisonStrategy)
Creates a new . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Object actual
protected final Object expected
Method Detail |
---|
public static AssertionErrorFactory shouldBeEqual(Object actual, Object expected)
ShouldBeEqual
.
actual
- the actual value in the failed assertion.expected
- the expected value in the failed assertion.
AssertionErrorFactory
.public static AssertionErrorFactory shouldBeEqual(Object actual, Object expected, org.fest.util.ComparisonStrategy comparisonStrategy)
ShouldBeEqual
.
actual
- the actual value in the failed assertion.expected
- the expected value in the failed assertion.comparisonStrategy
- the ComparisonStrategy
used to compare actual with expected.
AssertionErrorFactory
.public AssertionError newAssertionError(Description description)
AssertionError
indicating that an assertion that verifies that two objects are
equal failed.AssertionError
message is built so that it differentiates actual
and
expected
description in case their string representation are the same (like 42 float and 42 double).
If JUnit 4 is in the classpath and the description is standard (no comparator was used and actual
and
expected
string representation were differents), this method will instead create a
org.junit.ComparisonFailure that highlights the difference(s) between the expected and actual objects.
AssertionError
stack trace won't show Fest related elements if Failures
is configured to filter
them (see Failures.setRemoveFestRelatedElementsFromStackTrace(boolean)
).
newAssertionError
in interface AssertionErrorFactory
description
- the description of the failed assertion.
AssertionError
.public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |