tdd-java-demo
tdd java demo with micro-commits
git clone https://9o.is/git/tdd-java-demo.git
Item.java
(411B)
1 package takehome.model;
2
3 public class Item {
4 private final String name;
5 private final double cost;
6
7 public Item(String name, double cost) {
8 this.name = name;
9 this.cost = cost;
10 }
11
12 public String getName() {
13 return name;
14 }
15
16 public double getCost() {
17 return cost;
18 }
19
20 public double getTotal(int amount) {
21 return amount * getCost();
22 }
23 }