|
8 | 8 | import static junit.framework.Assert.assertEquals;
|
9 | 9 |
|
10 | 10 | public class _408Test {
|
11 |
| - private static _408.Solution1 solution1; |
12 |
| - private static Boolean expected; |
13 |
| - private static Boolean actual; |
14 |
| - private static String word; |
15 |
| - private static String abbr; |
16 |
| - |
17 |
| - @BeforeClass |
18 |
| - public static void setup() { |
19 |
| - solution1 = new _408.Solution1(); |
20 |
| - } |
21 |
| - |
22 |
| - @Before |
23 |
| - public void setupForEachTest() { |
24 |
| - word = ""; |
25 |
| - abbr = ""; |
26 |
| - } |
27 |
| - |
28 |
| - @Test |
29 |
| - public void test1() { |
30 |
| - word = "internationalization"; |
31 |
| - abbr = "i12iz4n"; |
32 |
| - expected = true; |
33 |
| - actual = solution1.validWordAbbreviation(word, abbr); |
34 |
| - assertEquals(expected, actual); |
35 |
| - } |
36 |
| - |
37 |
| - @Test |
38 |
| - public void test2() { |
39 |
| - word = "apple"; |
40 |
| - abbr = "a2e"; |
41 |
| - expected = false; |
42 |
| - actual = solution1.validWordAbbreviation(word, abbr); |
43 |
| - assertEquals(expected, actual); |
44 |
| - } |
45 |
| - |
46 |
| - @Test |
47 |
| - public void test3() { |
48 |
| - word = "internationalization"; |
49 |
| - abbr = "i5a11o1"; |
50 |
| - expected = true; |
51 |
| - actual = solution1.validWordAbbreviation(word, abbr); |
52 |
| - assertEquals(expected, actual); |
53 |
| - } |
54 |
| - |
55 |
| - @Test |
56 |
| - public void test4() { |
57 |
| - word = "hi"; |
58 |
| - abbr = "1"; |
59 |
| - expected = false; |
60 |
| - actual = solution1.validWordAbbreviation(word, abbr); |
61 |
| - assertEquals(expected, actual); |
62 |
| - } |
63 |
| - |
64 |
| - @Test |
65 |
| - public void test5() { |
66 |
| - word = "a"; |
67 |
| - abbr = "1"; |
68 |
| - expected = true; |
69 |
| - actual = solution1.validWordAbbreviation(word, abbr); |
70 |
| - assertEquals(expected, actual); |
71 |
| - } |
72 |
| - |
73 |
| - @Test |
74 |
| - public void test6() { |
75 |
| - word = "a"; |
76 |
| - abbr = "2"; |
77 |
| - expected = false; |
78 |
| - actual = solution1.validWordAbbreviation(word, abbr); |
79 |
| - assertEquals(expected, actual); |
80 |
| - } |
81 |
| - |
82 |
| - @Test |
83 |
| - public void test7() { |
84 |
| - word = "hi"; |
85 |
| - abbr = "1i"; |
86 |
| - expected = true; |
87 |
| - actual = solution1.validWordAbbreviation(word, abbr); |
88 |
| - assertEquals(expected, actual); |
89 |
| - } |
90 |
| - |
91 |
| - @Test |
92 |
| - public void test8() { |
93 |
| - word = "hi"; |
94 |
| - abbr = "3"; |
95 |
| - expected = false; |
96 |
| - actual = solution1.validWordAbbreviation(word, abbr); |
97 |
| - assertEquals(expected, actual); |
98 |
| - } |
99 |
| - |
100 |
| - @Test |
101 |
| - public void test9() { |
102 |
| - word = "hi"; |
103 |
| - abbr = "11"; |
104 |
| - expected = false; |
105 |
| - actual = solution1.validWordAbbreviation(word, abbr); |
106 |
| - assertEquals(expected, actual); |
107 |
| - } |
108 |
| - |
109 |
| - @Test |
110 |
| - public void test10() { |
111 |
| - word = "word"; |
112 |
| - abbr = "1o1d"; |
113 |
| - expected = true; |
114 |
| - actual = solution1.validWordAbbreviation(word, abbr); |
115 |
| - assertEquals(expected, actual); |
116 |
| - } |
117 |
| - |
118 |
| - @Test |
119 |
| - public void test11() { |
120 |
| - word = "abbreviation"; |
121 |
| - abbr = "a010n"; |
122 |
| - expected = false; |
123 |
| - actual = solution1.validWordAbbreviation(word, abbr); |
124 |
| - assertEquals(expected, actual); |
125 |
| - } |
| 11 | + private static _408.Solution1 solution1; |
| 12 | + private static Boolean expected; |
| 13 | + private static Boolean actual; |
| 14 | + private static String word; |
| 15 | + private static String abbr; |
| 16 | + |
| 17 | + @BeforeClass |
| 18 | + public static void setup() { |
| 19 | + solution1 = new _408.Solution1(); |
| 20 | + } |
| 21 | + |
| 22 | + @Before |
| 23 | + public void setupForEachTest() { |
| 24 | + word = ""; |
| 25 | + abbr = ""; |
| 26 | + } |
| 27 | + |
| 28 | + @Test |
| 29 | + public void test1() { |
| 30 | + word = "internationalization"; |
| 31 | + abbr = "i12iz4n"; |
| 32 | + expected = true; |
| 33 | + actual = solution1.validWordAbbreviation(word, abbr); |
| 34 | + assertEquals(expected, actual); |
| 35 | + } |
| 36 | + |
| 37 | + @Test |
| 38 | + public void test2() { |
| 39 | + word = "apple"; |
| 40 | + abbr = "a2e"; |
| 41 | + expected = false; |
| 42 | + actual = solution1.validWordAbbreviation(word, abbr); |
| 43 | + assertEquals(expected, actual); |
| 44 | + } |
| 45 | + |
| 46 | + @Test |
| 47 | + public void test3() { |
| 48 | + word = "internationalization"; |
| 49 | + abbr = "i5a11o1"; |
| 50 | + expected = true; |
| 51 | + actual = solution1.validWordAbbreviation(word, abbr); |
| 52 | + assertEquals(expected, actual); |
| 53 | + } |
| 54 | + |
| 55 | + @Test |
| 56 | + public void test4() { |
| 57 | + word = "hi"; |
| 58 | + abbr = "1"; |
| 59 | + expected = false; |
| 60 | + actual = solution1.validWordAbbreviation(word, abbr); |
| 61 | + assertEquals(expected, actual); |
| 62 | + } |
| 63 | + |
| 64 | + @Test |
| 65 | + public void test5() { |
| 66 | + word = "a"; |
| 67 | + abbr = "1"; |
| 68 | + expected = true; |
| 69 | + actual = solution1.validWordAbbreviation(word, abbr); |
| 70 | + assertEquals(expected, actual); |
| 71 | + } |
| 72 | + |
| 73 | + @Test |
| 74 | + public void test6() { |
| 75 | + word = "a"; |
| 76 | + abbr = "2"; |
| 77 | + expected = false; |
| 78 | + actual = solution1.validWordAbbreviation(word, abbr); |
| 79 | + assertEquals(expected, actual); |
| 80 | + } |
| 81 | + |
| 82 | + @Test |
| 83 | + public void test7() { |
| 84 | + word = "hi"; |
| 85 | + abbr = "1i"; |
| 86 | + expected = true; |
| 87 | + actual = solution1.validWordAbbreviation(word, abbr); |
| 88 | + assertEquals(expected, actual); |
| 89 | + } |
| 90 | + |
| 91 | + @Test |
| 92 | + public void test8() { |
| 93 | + word = "hi"; |
| 94 | + abbr = "3"; |
| 95 | + expected = false; |
| 96 | + actual = solution1.validWordAbbreviation(word, abbr); |
| 97 | + assertEquals(expected, actual); |
| 98 | + } |
| 99 | + |
| 100 | + @Test |
| 101 | + public void test9() { |
| 102 | + word = "hi"; |
| 103 | + abbr = "11"; |
| 104 | + expected = false; |
| 105 | + actual = solution1.validWordAbbreviation(word, abbr); |
| 106 | + assertEquals(expected, actual); |
| 107 | + } |
| 108 | + |
| 109 | + @Test |
| 110 | + public void test10() { |
| 111 | + word = "word"; |
| 112 | + abbr = "1o1d"; |
| 113 | + expected = true; |
| 114 | + actual = solution1.validWordAbbreviation(word, abbr); |
| 115 | + assertEquals(expected, actual); |
| 116 | + } |
| 117 | + |
| 118 | + @Test |
| 119 | + public void test11() { |
| 120 | + word = "abbreviation"; |
| 121 | + abbr = "a010n"; |
| 122 | + expected = false; |
| 123 | + actual = solution1.validWordAbbreviation(word, abbr); |
| 124 | + assertEquals(expected, actual); |
| 125 | + } |
126 | 126 | }
|
0 commit comments