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(expected=ServiceException.class) | |
| public void cannotCreateUserWithSameUsername() throws ServiceException { | |
| User user1 = new User("Jane", "Smith", "jsmith", "venus"); | |
| User user2 = new User("John", "Smith", "jsmith", "mars"); | |
| AuctionService service = null; | |
| try { | |
| service = new BaseAuctionService(); | |
| service.saveUser(user1); | |
| } catch (ServiceException e) { | |
| fail( e.getMessage() ); |
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(timeout=3000) | |
| public void canGetListOfAllPastAuctions() throws ServiceException { | |
| AuctionService service = new BaseAuctionService(); | |
| service.loadAuctionHistory(); | |
| Collection<Auction> pastAuctions = service.getPastAuctions(); | |
| assertNotNull("unable to get past auctions", pastAuctions); | |
| assertTrue("no past auctions", pastAuctions.size() > 0); | |
| } |
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
| @Ignore @Test | |
| public void canCreateIntegerPropertyAndValidate() { | |
| Property prop = | |
| new IntegerProperty("productRating", "Rating", false, 1, 10); | |
| /*************************************************************** | |
| * The following assertions will fail if executed. Remove this * | |
| * comment and the @Ignore annotation once refactoring of the * | |
| * PropertyFactory is complete. * | |
| ***************************************************************/ | |
| assertFalse("Property value should be invalid", prop.isValid(0)); |
NewerOlder