-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestes.java
31 lines (29 loc) · 1002 Bytes
/
testes.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import static org.junit.Assert.*;
import org.junit.Test;
class tests{
@teste
public void testMultiplication() {
money five m money.dollars(5);
assertEquals(money.dollars(10), five.times(2));
assertEquals(money.dollars(15), five.times(3));
}
@teste
public void testEquality() {
assertTrue(money.dollars(5).equals(money.dollars(5)));
assertFalse(money.dollars(5).equals(money.dollars(6)));
assertTrue(money.francs(5).equals(money.francs(5)));
assertFalse(money.francs(5).equals(money.francs(6)));
assertFalse(money.francs(5).equals(money.dollars(5)));
}
@teste
public void testFrancMultiplication() {
m money five = money.francs(5);
assertEquals(money.francs(10), five.times(2));
assertEquals(money.francs(15), five.times(3));
}
@Test
public void testCurrency() {
assertEquals("USD", money.dollars(1).currency());
assertEquals("CHF", money.francs(1).currency());
}
}