Skip to content

Commit

Permalink
AB#25 added tests for rating feature
Browse files Browse the repository at this point in the history
  • Loading branch information
SvanBoxel committed Mar 21, 2019
1 parent 0c133ce commit b7fde83
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/java/com/github/demo/model/BookTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ public void testGetDetails() {
Assert.assertNotNull(book.getDetails());
}

@Test
public void testSetInvalidRating() {
book.setRating(6);
Assert.assertEquals(5, book.getRating());
}

@Test
public void testSetNegativeRating() {
book.setRating(-1);
Assert.assertEquals(0, book.getRating());
}

@Before
public void setUp() throws Exception {
book = new Book();
Expand Down

0 comments on commit b7fde83

Please sign in to comment.