11import org .junit .jupiter .api .Disabled ;
2+ import org .junit .jupiter .api .DisplayName ;
23import org .junit .jupiter .api .Test ;
34
45import static org .assertj .core .api .Assertions .assertThat ;
56import static org .assertj .core .api .Assertions .assertThatExceptionOfType ;
67
78public class BaseConverterTest {
89
10+ @ DisplayName ("single bit one to decimal" )
911 @ Test
1012 public void testSingleBitOneToDecimal () {
1113 BaseConverter baseConverter = new BaseConverter (2 , new int []{1 });
@@ -14,6 +16,7 @@ public void testSingleBitOneToDecimal() {
1416 .containsExactly (1 );
1517 }
1618
19+ @ DisplayName ("binary to single decimal" )
1720 @ Disabled ("Remove to run test" )
1821 @ Test
1922 public void testBinaryToSingleDecimal () {
@@ -23,6 +26,7 @@ public void testBinaryToSingleDecimal() {
2326 .containsExactly (5 );
2427 }
2528
29+ @ DisplayName ("single decimal to binary" )
2630 @ Disabled ("Remove to run test" )
2731 @ Test
2832 public void testSingleDecimalToBinary () {
@@ -32,6 +36,7 @@ public void testSingleDecimalToBinary() {
3236 .containsExactly (1 , 0 , 1 );
3337 }
3438
39+ @ DisplayName ("binary to multiple decimal" )
3540 @ Disabled ("Remove to run test" )
3641 @ Test
3742 public void testBinaryToMultipleDecimal () {
@@ -41,6 +46,7 @@ public void testBinaryToMultipleDecimal() {
4146 .containsExactly (4 , 2 );
4247 }
4348
49+ @ DisplayName ("decimal to binary" )
4450 @ Disabled ("Remove to run test" )
4551 @ Test
4652 public void testDecimalToBinary () {
@@ -50,6 +56,7 @@ public void testDecimalToBinary() {
5056 .containsExactly (1 , 0 , 1 , 0 , 1 , 0 );
5157 }
5258
59+ @ DisplayName ("trinary to hexadecimal" )
5360 @ Disabled ("Remove to run test" )
5461 @ Test
5562 public void testTrinaryToHexadecimal () {
@@ -59,6 +66,7 @@ public void testTrinaryToHexadecimal() {
5966 .containsExactly (2 , 10 );
6067 }
6168
69+ @ DisplayName ("hexadecimal to trinary" )
6270 @ Disabled ("Remove to run test" )
6371 @ Test
6472 public void testHexadecimalToTrinary () {
@@ -68,6 +76,7 @@ public void testHexadecimalToTrinary() {
6876 .containsExactly (1 , 1 , 2 , 0 );
6977 }
7078
79+ @ DisplayName ("15-bit integer" )
7180 @ Disabled ("Remove to run test" )
7281 @ Test
7382 public void test15BitInteger () {
@@ -77,6 +86,7 @@ public void test15BitInteger() {
7786 .containsExactly (6 , 10 , 45 );
7887 }
7988
89+ @ DisplayName ("empty list" )
8090 @ Disabled ("Remove to run test" )
8191 @ Test
8292 public void testEmptyDigits () {
@@ -86,6 +96,7 @@ public void testEmptyDigits() {
8696 .containsExactly (0 );
8797 }
8898
99+ @ DisplayName ("single zero" )
89100 @ Disabled ("Remove to run test" )
90101 @ Test
91102 public void testSingleZero () {
@@ -95,6 +106,7 @@ public void testSingleZero() {
95106 .containsExactly (0 );
96107 }
97108
109+ @ DisplayName ("multiple zeros" )
98110 @ Disabled ("Remove to run test" )
99111 @ Test
100112 public void testMultipleZeros () {
@@ -104,6 +116,7 @@ public void testMultipleZeros() {
104116 .containsExactly (0 );
105117 }
106118
119+ @ DisplayName ("leading zeros" )
107120 @ Disabled ("Remove to run test" )
108121 @ Test
109122 public void testLeadingZeros () {
@@ -113,22 +126,25 @@ public void testLeadingZeros() {
113126 .containsExactly (4 , 2 );
114127 }
115128
129+ @ DisplayName ("input base is one" )
116130 @ Disabled ("Remove to run test" )
117131 @ Test
118132 public void testFirstBaseIsOne () {
119133 assertThatExceptionOfType (IllegalArgumentException .class )
120- .isThrownBy (() -> new BaseConverter (1 , new int []{1 }))
134+ .isThrownBy (() -> new BaseConverter (1 , new int []{0 }))
121135 .withMessage ("Bases must be at least 2." );
122136 }
123137
138+ @ DisplayName ("input base is zero" )
124139 @ Disabled ("Remove to run test" )
125140 @ Test
126141 public void testFirstBaseIsZero () {
127142 assertThatExceptionOfType (IllegalArgumentException .class )
128- .isThrownBy (() -> new BaseConverter (0 , new int []{1 }))
143+ .isThrownBy (() -> new BaseConverter (0 , new int []{}))
129144 .withMessage ("Bases must be at least 2." );
130145 }
131146
147+ @ DisplayName ("input base is negative" )
132148 @ Disabled ("Remove to run test" )
133149 @ Test
134150 public void testFirstBaseIsNegative () {
@@ -137,6 +153,7 @@ public void testFirstBaseIsNegative() {
137153 .withMessage ("Bases must be at least 2." );
138154 }
139155
156+ @ DisplayName ("negative digit" )
140157 @ Disabled ("Remove to run test" )
141158 @ Test
142159 public void testNegativeDigit () {
@@ -145,6 +162,7 @@ public void testNegativeDigit() {
145162 .withMessage ("Digits may not be negative." );
146163 }
147164
165+ @ DisplayName ("invalid positive digit" )
148166 @ Disabled ("Remove to run test" )
149167 @ Test
150168 public void testInvalidPositiveDigit () {
@@ -153,6 +171,7 @@ public void testInvalidPositiveDigit() {
153171 .withMessage ("All digits must be strictly less than the base." );
154172 }
155173
174+ @ DisplayName ("output base is one" )
156175 @ Disabled ("Remove to run test" )
157176 @ Test
158177 public void testSecondBaseIsOne () {
@@ -164,6 +183,7 @@ public void testSecondBaseIsOne() {
164183 .withMessage ("Bases must be at least 2." );
165184 }
166185
186+ @ DisplayName ("output base is zero" )
167187 @ Disabled ("Remove to run test" )
168188 @ Test
169189 public void testSecondBaseIsZero () {
@@ -174,6 +194,7 @@ public void testSecondBaseIsZero() {
174194 .withMessage ("Bases must be at least 2." );
175195 }
176196
197+ @ DisplayName ("output base is negative" )
177198 @ Disabled ("Remove to run test" )
178199 @ Test
179200 public void testSecondBaseIsNegative () {
0 commit comments