Merge pull request #10 from olim7t/github-58
github #58 - add example for Properties.ofType().
This commit is contained in:
commit
8c0e92c538
|
@ -125,6 +125,11 @@ public class IterableAssertionsExamples extends AbstractAssertionsExamples {
|
|||
.doesNotContain("Sauron", "Elrond");
|
||||
// in Fest 1.x, this would have been written :
|
||||
// assertThat(fellowshipOfTheRing).onProperty("name").contains("Boromir", "Gandalf", "Frodo", "Legolas");
|
||||
|
||||
// same extraction with an alternate syntax
|
||||
assertThat(extractProperty("name").ofType(String.class).from(fellowshipOfTheRing))
|
||||
.contains("Boromir", "Gandalf", "Frodo", "Legolas")
|
||||
.doesNotContain("Sauron", "Elrond");
|
||||
|
||||
// extracting property works also with user's types (here Race)
|
||||
assertThat(extractProperty("race").from(fellowshipOfTheRing)).contains(HOBBIT, ELF).doesNotContain(ORC);
|
||||
|
|
Loading…
Reference in New Issue