Last active
September 27, 2015 10:28
-
-
Save tonypiazza/1255701 to your computer and use it in GitHub Desktop.
Example usage of the assertThat method of the org.junit.Assert class
This file contains hidden or 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
@Test | |
public void canGetAuctionsForUsername() throws ServiceException { | |
String username = "tpiazza"; | |
Auction[] auctions = new Auction[5 + new Random().nextInt(16)]; | |
for(int i = 0; i < auctions.length; i++) { | |
Auction auction = createDummyAuction( username ); | |
auctions[i] = auction; | |
service.saveAuction( auction ); | |
} | |
assertThat( service.getAuctions(username), hasItems(auctions) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment