public class Expactamundo extends Object
Person expected = Expectamundo.prototype(Person.class);
Expectamundo.expect(expected.getFirstName()).equalTo("Jane");
Expectamundo.expect(expected.getLastName()).equalTo("Doe");
Expectamundo.verify(new Person("Jane","Doe")).matches(expected));
Person expected = Expectamundo.prototype(Person.class);
Expectamundo.expect(expected.getSiblings().get(0).getFirstName()).equalTo("John");
Expectamundo.expect(expected.getSiblings().get(0).getLastName()).equalTo("Doe");
Person jane = new Person("Jane","Doe");
jane.addSibling(new Person("John","Doe"));
Expectamundo.verify(jane).matches(expected));
To verifying map properties
Person expected = Expectamundo.prototype(Person.class);
Expectamundo.expect(expected.getSiblingMap().get("John").getFirstName()).equalTo("John");
Expectamundo.expect(expected.getSiblingMap().get("John").getLastName()).equalTo("Doe");
Person jane = new Person("Jane","Doe");
jane.addSibling(new Person("John","Doe"));
Expectamundo.verify(jane).matches(expected));
| Constructor and Description |
|---|
Expactamundo() |
| Modifier and Type | Method and Description |
|---|---|
static PrototypeObjectExpectation |
expect(Object property)
Setup an expecation for a property on a
Prototype |
static <E,T extends Collection<E>> |
expect(T property)
Setup an expecation for a collection property on a
Prototype |
static <T extends Comparable<T>> |
expect(T property)
Setup an expecation for a comparable property on a
Prototype |
static <T> org.hamcrest.Matcher<T> |
matches(T expected) |
static <T> T |
prototype(Class<T> type)
Prepare a new prototype
|
static <T> T |
prototype(TypeReference<T> typeRef)
Prepare a new prototype for a generic type
|
static <T> PrototypeVerifier<T> |
verify(T test) |
public static <T> T prototype(Class<T> type)
public static <T> T prototype(TypeReference<T> typeRef)
public static <E,T extends Collection<E>> PrototypeCollectionExpectation<E,T> expect(T property)
Prototypepublic static <T extends Comparable<T>> PrototypeComparableExpectation<T> expect(T property)
Prototypepublic static PrototypeObjectExpectation expect(Object property)
Prototypepublic static <T> PrototypeVerifier<T> verify(T test)
public static <T> org.hamcrest.Matcher<T> matches(T expected)
Copyright © 2014. All Rights Reserved.