2
2
import static org .assertj .core .api .Assertions .assertThatExceptionOfType ;
3
3
4
4
import org .junit .jupiter .api .Disabled ;
5
+ import org .junit .jupiter .api .DisplayName ;
5
6
import org .junit .jupiter .api .Test ;
6
7
7
8
import java .util .Arrays ;
8
9
9
10
public class OpticalCharacterReaderTest {
10
11
11
12
@ Test
13
+ @ DisplayName ("Recognizes 0" )
12
14
public void testReaderRecognizesSingle0 () {
13
15
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
14
16
" _ " ,
@@ -23,6 +25,7 @@ public void testReaderRecognizesSingle0() {
23
25
24
26
@ Disabled ("Remove to run test" )
25
27
@ Test
28
+ @ DisplayName ("Recognizes 1" )
26
29
public void testReaderRecognizesSingle1 () {
27
30
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
28
31
" " ,
@@ -36,6 +39,7 @@ public void testReaderRecognizesSingle1() {
36
39
37
40
@ Disabled ("Remove to run test" )
38
41
@ Test
42
+ @ DisplayName ("Unreadable but correctly sized inputs return ?" )
39
43
public void testReaderReturnsQuestionMarkForUnreadableButCorrectlySizedInput () {
40
44
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
41
45
" " ,
@@ -49,6 +53,7 @@ public void testReaderReturnsQuestionMarkForUnreadableButCorrectlySizedInput() {
49
53
50
54
@ Disabled ("Remove to run test" )
51
55
@ Test
56
+ @ DisplayName ("Input with a number of lines that is not a multiple of four raises an error" )
52
57
public void testReaderThrowsExceptionWhenNumberOfInputLinesIsNotAMultipleOf4 () {
53
58
54
59
assertThatExceptionOfType (IllegalArgumentException .class )
@@ -63,6 +68,7 @@ public void testReaderThrowsExceptionWhenNumberOfInputLinesIsNotAMultipleOf4() {
63
68
64
69
@ Disabled ("Remove to run test" )
65
70
@ Test
71
+ @ DisplayName ("Input with a number of columns that is not a multiple of three raises an error" )
66
72
public void testReaderThrowsExceptionWhenNumberOfInputColumnsIsNotAMultipleOf3 () {
67
73
68
74
@@ -79,6 +85,7 @@ public void testReaderThrowsExceptionWhenNumberOfInputColumnsIsNotAMultipleOf3()
79
85
80
86
@ Disabled ("Remove to run test" )
81
87
@ Test
88
+ @ DisplayName ("Recognizes 110101100" )
82
89
public void testReaderRecognizesBinarySequence110101100 () {
83
90
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
84
91
" _ _ _ _ " ,
@@ -92,6 +99,7 @@ public void testReaderRecognizesBinarySequence110101100() {
92
99
93
100
@ Disabled ("Remove to run test" )
94
101
@ Test
102
+ @ DisplayName ("Garbled numbers in a string are replaced with ?" )
95
103
public void testReaderReplacesUnreadableDigitsWithQuestionMarksWithinSequence () {
96
104
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
97
105
" _ _ _ " ,
@@ -106,6 +114,7 @@ public void testReaderReplacesUnreadableDigitsWithQuestionMarksWithinSequence()
106
114
107
115
@ Disabled ("Remove to run test" )
108
116
@ Test
117
+ @ DisplayName ("Recognizes 2" )
109
118
public void testReaderRecognizesSingle2 () {
110
119
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
111
120
" _ " ,
@@ -119,6 +128,7 @@ public void testReaderRecognizesSingle2() {
119
128
120
129
@ Disabled ("Remove to run test" )
121
130
@ Test
131
+ @ DisplayName ("Recognizes 3" )
122
132
public void testReaderRecognizesSingle3 () {
123
133
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
124
134
" _ " ,
@@ -132,6 +142,7 @@ public void testReaderRecognizesSingle3() {
132
142
133
143
@ Disabled ("Remove to run test" )
134
144
@ Test
145
+ @ DisplayName ("Recognizes 4" )
135
146
public void testReaderRecognizesSingle4 () {
136
147
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
137
148
" " ,
@@ -145,6 +156,7 @@ public void testReaderRecognizesSingle4() {
145
156
146
157
@ Disabled ("Remove to run test" )
147
158
@ Test
159
+ @ DisplayName ("Recognizes 5" )
148
160
public void testReaderRecognizesSingle5 () {
149
161
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
150
162
" _ " ,
@@ -158,6 +170,7 @@ public void testReaderRecognizesSingle5() {
158
170
159
171
@ Disabled ("Remove to run test" )
160
172
@ Test
173
+ @ DisplayName ("Recognizes 6" )
161
174
public void testReaderRecognizesSingle6 () {
162
175
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
163
176
" _ " ,
@@ -171,6 +184,7 @@ public void testReaderRecognizesSingle6() {
171
184
172
185
@ Disabled ("Remove to run test" )
173
186
@ Test
187
+ @ DisplayName ("Recognizes 7" )
174
188
public void testReaderRecognizesSingle7 () {
175
189
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
176
190
" _ " ,
@@ -184,6 +198,7 @@ public void testReaderRecognizesSingle7() {
184
198
185
199
@ Disabled ("Remove to run test" )
186
200
@ Test
201
+ @ DisplayName ("Recognizes 8" )
187
202
public void testReaderRecognizesSingle8 () {
188
203
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
189
204
" _ " ,
@@ -197,6 +212,7 @@ public void testReaderRecognizesSingle8() {
197
212
198
213
@ Disabled ("Remove to run test" )
199
214
@ Test
215
+ @ DisplayName ("Recognizes 9" )
200
216
public void testReaderRecognizesSingle9 () {
201
217
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
202
218
" _ " ,
@@ -210,6 +226,7 @@ public void testReaderRecognizesSingle9() {
210
226
211
227
@ Disabled ("Remove to run test" )
212
228
@ Test
229
+ @ DisplayName ("Recognizes string of decimal numbers" )
213
230
public void testReaderRecognizesSequence1234567890 () {
214
231
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
215
232
" _ _ _ _ _ _ _ _ " ,
@@ -223,6 +240,7 @@ public void testReaderRecognizesSequence1234567890() {
223
240
224
241
@ Disabled ("Remove to run test" )
225
242
@ Test
243
+ @ DisplayName ("Numbers separated by empty lines are recognized. Lines are joined by commas." )
226
244
public void testReaderRecognizesAndCorrectlyFormatsMultiRowInput () {
227
245
String parsedInput = new OpticalCharacterReader ().parse (Arrays .asList (
228
246
" _ _ " ,
0 commit comments