public class PrototypeStringExpectation extends PrototypeComparableExpectation<String>
| Constructor and Description |
|---|
PrototypeStringExpectation(Prototype<?> prototype,
PrototypeProperty property) |
| Modifier and Type | Method and Description |
|---|---|
void |
hasLength(int expectedSize)
Set an expectation that the property value is of the given length.
|
void |
hasPattern(String pattern)
Set an expectation that the property value matches a regular expression.
|
void |
isEqualToIgnoreCase(String expected)
Set an expectation that the property value matches another property regardless of case.
|
isComparableTohasExpectation, isEqualTo, isInstanceOf, isNotEqualTo, isNotNull, isNull, isOneOf, isOneOf, matchespublic PrototypeStringExpectation(Prototype<?> prototype, PrototypeProperty property)
public void hasLength(int expectedSize)
MyObject expected = prototype(MyObject.class); expect(expected.name()).hasLength(52); expectThat(actual).matches(expected);
expectedSize - the expected size of the property valuepublic void hasPattern(String pattern)
MyObject expected = prototype(MyObject.class);
expect(expected.name()).hasPattern("A.*");
expectThat(actual).matches(expected);
pattern - the pattern to match againstpublic void isEqualToIgnoreCase(String expected)
MyObject expected = prototype(MyObject.class);
expect(expected.name()).isEqualToIgnoreCase("jANe");
expectThat(actual).matches(expected);
expected - the value to check againstCopyright © 2015. All rights reserved.