Skip to content

Commit 3025e99

Browse files
committed
First four tests of ProductTest working
1 parent 6bd85ec commit 3025e99

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package pl.edu.agh.mwo.invoice;
2+
3+
public class Demo {
4+
public static void main(String[] args) {
5+
System.out.println(0.1 + 0.2);
6+
}
7+
}

src/main/java/pl/edu/agh/mwo/invoice/product/Product.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ protected Product(String name, BigDecimal price, BigDecimal tax) {
1616
}
1717

1818
public String getName() {
19-
return null;
19+
return this.name;
2020
}
2121

2222
public BigDecimal getPrice() {
23-
return null;
23+
return this.price;
2424
}
2525

2626
public BigDecimal getTaxPercent() {
27-
return null;
27+
return this.taxPercent;
2828
}
2929

3030
public BigDecimal getPriceWithTax() {
31-
return null;
31+
return this.getPrice().multiply(this.taxPercent).add(this.price);
3232
}
3333
}

0 commit comments

Comments
 (0)