Created
September 29, 2015 12:55
-
-
Save stephan-mueller/8a524bd7cc42602967f2 to your computer and use it in GitHub Desktop.
Test class for the builder {@link CustomerBuilder} with Hamcrest assertions
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 CustomerBuilderHamcrestTest { | |
private Customer customer; | |
@Before | |
public void setUp() throws Exception { | |
customer = Customer.newBuilder() | |
.setFirstName("Max") | |
.setLastName("Mustermann") | |
.setEmail("max.mustermann@openknowledge.de") | |
.build(); | |
} | |
@Test | |
public void build() throws Exception { | |
assertThat(customer, notNullValue()); | |
assertThat(customer.getFirstName(), equalTo("Max")); | |
assertThat(customer.getLastName(), equalTo("Mustermann")); | |
assertThat(customer.getEmail(), equalTo("max.mustermann@openknowledge.de")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment