-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathTestGroups.java
More file actions
86 lines (64 loc) · 2.49 KB
/
TestGroups.java
File metadata and controls
86 lines (64 loc) · 2.49 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
package com.testcase;
import java.util.Locale;
import org.testng.Assert;
import org.testng.annotations.Test;
import com.mapper.CodeProperties;
import com.mapper.CodePropertiesLookup;
public class TestGroups {
public CodeProperties code = null;
@Test(groups={"ISOCODE"})
public void testNumericCode(){
String isoCode[] = {"AOA","XOF","XDR","KWD","CLF","CHW","SSP","CLF","CHW","UYI","XBB","XBC"};
String expected[] = {"973","952","960","414","990","948","728","990","948","940","956","957"};
String actual[] = new String[isoCode.length];
for(int i = 0; i<isoCode.length; i++){
code = CodePropertiesLookup.getCodeProperties(isoCode[i]);
actual[i] = code.getCurrencyCode();
}
Assert.assertEquals(actual, expected);
}
@Test(groups={"ISOCODE"})
public void testMinorUnit(){
String isoCode[] = {"AOA","XOF","XDR","KWD","CLF","CHW","SSP","CLF","CHW","UYI","XBB","XBC"};
int expected[] = {2,0,-1,3,0,2,2,0,2,0,-1,-1};
int actual[] = new int[isoCode.length];
for(int i = 0; i<isoCode.length; i++){
code = CodePropertiesLookup.getCodeProperties(isoCode[i]);
actual[i] = code.getFractionDigits();
}
Assert.assertEquals(actual, expected);
}
@Test(groups={"LOCALE"})
public void testLocaleName(){
Locale[] locale = {Locale.CANADA,Locale.CHINA,Locale.FRANCE,Locale.KOREA};
String expected[] = {"Canadian Dollar","Yuan Renminbi","Euro","Won"};
String actual[] = new String[locale.length];
for(int i = 0; i<locale.length; i++){
code = CodePropertiesLookup.getCodeProperties(locale[i]);
actual[i] = code.getCurrencyName();
}
Assert.assertEquals(actual, expected);
}
@Test(groups={"GRP"})
public void testLocaleName2(){
Locale[] locale = {Locale.CANADA,Locale.CHINA,Locale.FRANCE,Locale.KOREA};
String expected[] = {"Canadian Dollar","Yuan Renminbi","Euro","Won"};
String actual[] = new String[locale.length];
for(int i = 0; i<locale.length; i++){
code = CodePropertiesLookup.getCodeProperties(locale[i]);
actual[i] = code.getCurrencyName();
}
Assert.assertEquals(actual, expected);
}
@Test(groups={"LOCALE"},dependsOnGroups={"ISOCODE","GRP"})
public void testLocaleSymbol(){
Locale[] locale = {Locale.CANADA,Locale.CHINA,Locale.FRANCE,Locale.KOREA};;
String expected[] = {"CAD","CNY","EUR","KRW"};
String actual[] = new String[locale.length];
for(int i = 0; i<locale.length; i++){
code = CodePropertiesLookup.getCodeProperties(locale[i]);
actual[i] = code.getSymbol();
}
Assert.assertEquals(actual, expected);
}
}