Last active
June 1, 2016 00:56
-
-
Save mroger/155c992147f4851bb2dbbb2e53aa0a3f to your computer and use it in GitHub Desktop.
Test class using custom matcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PersonTest { | |
private Person person; | |
@Before | |
public void setUp() { | |
person = new Person(); | |
} | |
@Test | |
public void shouldMatchCriteriaDynamicProxyWay() { | |
person.setName("Bruce Wayne"); | |
person.setAge(15); | |
List<String> options = Arrays.asList(new String[] {"1", "2", "3"}); | |
person.setOptions(options); | |
assertThat(person, aPerson() | |
.withName("Bruce Wayne") | |
.withAge(lessThan(20)) | |
.withOptions(Arrays.asList(new String[] {"1", "2", "3"}))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment