tdd-java-demo
tdd java demo with micro-commits
git clone https://9o.is/git/tdd-java-demo.git
ItemTest.java
(512B)
1 package takehome.model;
2
3 import org.junit.jupiter.api.Test;
4
5 import static org.hamcrest.MatcherAssert.assertThat;
6 import static org.hamcrest.Matchers.is;
7
8 class ItemTest {
9
10 public static final Item ITEM = new Item("soup", 0.65);
11
12 @Test
13 public void getName() {
14 assertThat(ITEM.getName(), is("soup"));
15 }
16
17 @Test
18 public void getCost() {
19 assertThat(ITEM.getCost(), is(0.65));
20 }
21
22 @Test
23 public void getTotal() {
24 assertThat(ITEM.getTotal(2), is(1.30));
25 }
26 }