-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathCurrencyConverterTest.java
More file actions
103 lines (83 loc) · 2.81 KB
/
CurrencyConverterTest.java
File metadata and controls
103 lines (83 loc) · 2.81 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import java.util.HashMap;
public class CurrencyConverterTest {
private static CurrencyConverter tester;
@Before
public void setUp() {
tester = new CurrencyConverter();
}
@Test
public void testCurrencyConverter() {
String expected = "609.76";
String actual = tester.currencyConverter("GBP", "USD", 500.00F);
Assert.assertEquals(expected, actual);
}
@Test
public void dollarToEuro() {
String expected = "470";
String actual = tester.currencyConverter("USD", "EUR", 500.00F);
Assert.assertEquals(expected, actual);
}
@Test
public void euroToDollar() {
String expected = "531.91";
String actual = tester.currencyConverter("EUR", "USD", 500.00F);
Assert.assertEquals(expected, actual);
}
@Test
public void britishPoundToDollar() {
String expected = "609.76";
String actual = tester.currencyConverter("GBP", "USD", 500.00F);
Assert.assertEquals(expected, actual);
}
@Test
public void euroToBritishPound() {
String expected = "436.17";
String actual = tester.currencyConverter("EUR", "GBP", 500.00F);
Assert.assertEquals(expected, actual);
}
@Test
public void britishPoundToIndianRupee() {
String expected = "41658.54";
String actual = tester.currencyConverter("GBP", "INR", 500.00F);
Assert.assertEquals(expected, actual);
}
@Test
public void rupeeToCanadianDollar() {
String expected = "9.66";
String actual = tester.currencyConverter("INR", "CAD", 500.00F);
Assert.assertEquals(expected, actual);
}
@Test
public void canadianDollarToSingaporeDollar() {
String expected = "541.67";
String actual = tester.currencyConverter("CAD", "SGD", 500.00F);
Assert.assertEquals(expected, actual);
}
@Test
public void SingaporeDollarToSwissFranc() {
String expected = "353.15";
String actual = tester.currencyConverter("SGD", "CHF", 500.00F);
Assert.assertEquals(expected, actual);
}
@Test
public void SwissFrancToMalaysianRinggit() {
String expected = "2212.87";
String actual = tester.currencyConverter("CHF", "MYR", 500.00F);
Assert.assertEquals(expected, actual);
}
@Test
public void MalaysianRinggitToJapaneseYen() {
String expected = "12957.5";
String actual = tester.currencyConverter("MYR", "JPY", 500.00F);
Assert.assertEquals(expected, actual);
}
@Test
public void JapaneseYenToChineseYuanRenminbi() {
String expected = "29.87";
String actual = tester.currencyConverter("JPY", "CNY", 500.00F);
Assert.assertEquals(expected, actual);
}
}