T
- The "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation"
for more details.public interface AssertOnValueEquality<T extends AssertOnValueEquality<T>>
Modifier and Type | Method and Description |
---|---|
T |
isEqualTo(Boolean expected)
Verifies that the value is equal to a boolean.
|
T |
isEqualTo(byte[] expected)
Verifies that the value is equal to a array of bytes.
|
T |
isEqualTo(DateTimeValue expected)
Verifies that the value is equal to a date/time value.
|
T |
isEqualTo(DateValue expected)
Verifies that the value is equal to a date value.
|
T |
isEqualTo(Number expected)
Verifies that the value is equal to a number.
|
T |
isEqualTo(String expected)
Verifies that the value is equal to a text.
|
T |
isEqualTo(TimeValue expected)
Verifies that the value is equal to a time value.
|
T |
isFalse()
Verifies that the value is equal to false boolean.
|
T |
isTrue()
Verifies that the value is equal to true boolean.
|
T |
isZero()
Verifies that the value is equal to zero.
|
T isEqualTo(Boolean expected)
Example where the assertion verifies that the value in the first Column
of the first Row
of the
Table
is equal to true boolean :
assertThat(table).row().value().isEqualTo(true);
Example where the assertion verifies that the value in the first Column
of the Row
at end point
of the first Change
is equal to true boolean :
assertThat(changes).change().rowAtEndPoint().value().isEqualTo(true);
expected
- The expected boolean value.this
assertion object.AssertionError
- If the value is not equal to the boolean in parameter.AbstractValueAssert.isEqualTo(Boolean)
,
AbstractAssertWithValues.isEqualTo(Boolean)
T isTrue()
Example with the value in the first Column
of the first Row
of the Table
:
assertThat(table).row().value().isTrue();
Example where the assertion verifies that the value in the first Column
of the Row
at end point
of the first Change
:
assertThat(changes).change().rowAtEndPoint().value().isTrue();
this
assertion object.AssertionError
- If the value is not equal to true boolean.AbstractValueAssert.isTrue()
,
AbstractAssertWithValues.isTrue()
T isFalse()
Example with the value in the first Column
of the first Row
of the Table
:
assertThat(table).row().value().isFalse();
Example where the assertion verifies that the value in the first Column
of the Row
at end point
of the first Change
:
assertThat(changes).change().rowAtEndPoint().value().isFalse();
this
assertion object.AssertionError
- If the value is not equal to false boolean.AbstractValueAssert.isFalse()
,
AbstractAssertWithValues.isFalse()
T isEqualTo(Number expected)
Example where the assertion verifies that the value in the first Column
of the first Row
of the
Table
is equal to number 3 :
assertThat(table).row().value().isEqualTo(3);
Example where the assertion verifies that the value in the first Column
of the Row
at end point
of the first Change
is equal to number 3 :
assertThat(changes).change().rowAtEndPoint().value().isEqualTo(3);
expected
- The expected number value.this
assertion object.AssertionError
- If the value is not equal to the number in parameter.AbstractValueAssert.isEqualTo(Number)
,
AbstractAssertWithValues.isEqualTo(Number)
T isEqualTo(byte[] expected)
Example where the assertion verifies that the value in the first Column
of the first Row
of the
Table
is equal to a array of bytes loaded from a file in the classpath :
byte[] bytes = bytesContentFromClassPathOf("file.png");
assertThat(table).row().value().isEqualTo(bytes);
Example where the assertion verifies that the value in the first Column
of the Row
at end point
of the first Change
is equal to a array of bytes loaded from a file in the classpath :
byte[] bytes = bytesContentFromClassPathOf("file.png");
assertThat(changes).change().rowAtEndPoint().value().isEqualTo(bytes);
expected
- The expected array of bytes value.this
assertion object.AssertionError
- If the value is not equal to the array of bytes in parameter.AbstractValueAssert.isEqualTo(byte[])
,
AbstractAssertWithValues.isEqualTo(byte[])
T isEqualTo(String expected)
Example where the assertion verifies that the value in the first Column
of the first Row
of the
Table
is equal to a text :
assertThat(table).row().value().isEqualTo("text");
Example where the assertion verifies that the value in the first Column
of the Row
at end point
of the first Change
is equal to a text :
assertThat(changes).change().rowAtEndPoint().value().isEqualTo("text");
expected
- The expected text value.this
assertion object.AssertionError
- If the value is not equal to the text in parameter.AbstractValueAssert.isEqualTo(String)
,
AbstractAssertWithValues.isEqualTo(String)
T isEqualTo(DateValue expected)
Example where the assertion verifies that the value in the first Column
of the first Row
of the
Table
is equal to a date value :
assertThat(table).row().value().isEqualTo(DateValue.of(2014, 7, 7));
Example where the assertion verifies that the value in the first Column
of the Row
at end point
of the first Change
is equal to a date value :
assertThat(changes).change().rowAtEndPoint().value().isEqualTo(DateValue.of(2014, 7, 7));
expected
- The expected date value.this
assertion object.AssertionError
- If the value is not equal to the date value in parameter.AbstractValueAssert.isEqualTo(DateValue)
,
AbstractAssertWithValues.isEqualTo(DateValue)
T isEqualTo(TimeValue expected)
Example where the assertion verifies that the value in the first Column
of the first Row
of the
Table
is equal to a time value :
assertThat(table).row().value().isEqualTo(TimeValue.of(21, 29, 30));
Example where the assertion verifies that the value in the first Column
of the Row
at end point
of the first Change
is equal to a time value :
assertThat(changes).change().rowAtEndPoint().value().isEqualTo(TimeValue.of(21, 29, 30));
expected
- The expected time value.this
assertion object.AssertionError
- If the value is not equal to the time value in parameter.AbstractValueAssert.isEqualTo(TimeValue)
,
AbstractAssertWithValues.isEqualTo(TimeValue)
T isEqualTo(DateTimeValue expected)
Example where the assertion verifies that the value in the first Column
of the first Row
of the
Table
is equal to a date/time value :
assertThat(table).row().value().isEqualTo(DateTimeValue.of(DateValue.of(2014, 7, 7), TimeValue.of(21, 29)));
Example where the assertion verifies that the value in the first Column
of the Row
at end point
of the first Change
is equal to a date/time value :
assertThat(changes).change().rowAtEndPoint().value().isEqualTo(DateTimeValue.of(DateValue.of(2014, 7, 7), TimeValue.of(21, 29)));
expected
- The expected date/time value.this
assertion object.AssertionError
- If the value is not equal to the date/time value in parameter.AbstractValueAssert.isEqualTo(DateTimeValue)
,
AbstractAssertWithValues.isEqualTo(DateTimeValue)
T isZero()
Example where the assertion verifies that the value in the first Column
of the first Row
of the
Table
is equal to zero :
assertThat(table).row().value().isZero();
Example where the assertion verifies that the value in the first Column
of the Row
at end point
of the first Change
is equal to zero :
assertThat(changes).change().rowAtEndPoint().value().isZero();
this
assertion object.AssertionError
- If the value is not equal to zero.AbstractValueAssert.isZero()
,
AbstractAssertWithValues.isZero()
Copyright © 2015 AssertJ. All Rights Reserved.