11import org .junit .jupiter .api .Test ;
22import org .junit .jupiter .api .Disabled ;
3+ import org .junit .jupiter .api .DisplayName ;
34
45import java .util .List ;
56
910public class IntergalacticTransmissionTest {
1011
1112 @ Test
13+ @ DisplayName ("calculate transmit sequences" )
1214 public void calculateTransmitSequencesEmptyMessage () {
1315 List <Integer > input = List .of ();
1416 List <Integer > expected = List .of ();
@@ -18,6 +20,7 @@ public void calculateTransmitSequencesEmptyMessage() {
1820
1921 @ Disabled ("Remove to run test" )
2022 @ Test
23+ @ DisplayName ("0x00 is transmitted as 0x0000" )
2124 public void calculateTransmitSequences0x00IsTransmittedAs0x0000 () {
2225 List <Integer > input = List .of (0x00 );
2326 List <Integer > expected = List .of (0x00 , 0x00 );
@@ -27,6 +30,7 @@ public void calculateTransmitSequences0x00IsTransmittedAs0x0000() {
2730
2831 @ Disabled ("Remove to run test" )
2932 @ Test
33+ @ DisplayName ("0x02 is transmitted as 0x0300" )
3034 public void calculateTransmitSequences0x02IsTransmittedAs0x0300 () {
3135 List <Integer > input = List .of (0x02 );
3236 List <Integer > expected = List .of (0x03 , 0x00 );
@@ -36,6 +40,7 @@ public void calculateTransmitSequences0x02IsTransmittedAs0x0300() {
3640
3741 @ Disabled ("Remove to run test" )
3842 @ Test
43+ @ DisplayName ("0x06 is transmitted as 0x0600" )
3944 public void calculateTransmitSequences0x06IsTransmittedAs0x0600 () {
4045 List <Integer > input = List .of (0x06 );
4146 List <Integer > expected = List .of (0x06 , 0x00 );
@@ -45,6 +50,7 @@ public void calculateTransmitSequences0x06IsTransmittedAs0x0600() {
4550
4651 @ Disabled ("Remove to run test" )
4752 @ Test
53+ @ DisplayName ("0x05 is transmitted as 0x0581" )
4854 public void calculateTransmitSequences0x05IsTransmittedAs0x0581 () {
4955 List <Integer > input = List .of (0x05 );
5056 List <Integer > expected = List .of (0x05 , 0x81 );
@@ -54,6 +60,7 @@ public void calculateTransmitSequences0x05IsTransmittedAs0x0581() {
5460
5561 @ Disabled ("Remove to run test" )
5662 @ Test
63+ @ DisplayName ("0x29 is transmitted as 0x2881" )
5764 public void calculateTransmitSequences0x29IsTransmittedAs0x2881 () {
5865 List <Integer > input = List .of (0x29 );
5966 List <Integer > expected = List .of (0x28 , 0x81 );
@@ -63,6 +70,7 @@ public void calculateTransmitSequences0x29IsTransmittedAs0x2881() {
6370
6471 @ Disabled ("Remove to run test" )
6572 @ Test
73+ @ DisplayName ("0xc001c0de is transmitted as 0xc000711be1" )
6674 public void calculateTransmitSequences0xc001c0deIsTransmittedAs0xc000711be1 () {
6775 List <Integer > input = List .of (0xc0 , 0x01 , 0xc0 , 0xde );
6876 List <Integer > expected = List .of (0xc0 , 0x00 , 0x71 , 0x1b , 0xe1 );
@@ -72,6 +80,7 @@ public void calculateTransmitSequences0xc001c0deIsTransmittedAs0xc000711be1() {
7280
7381 @ Disabled ("Remove to run test" )
7482 @ Test
83+ @ DisplayName ("six byte message" )
7584 public void calculateTransmitSequencesSixByteMessage () {
7685 List <Integer > input = List .of (0x47 , 0x72 , 0x65 , 0x61 , 0x74 , 0x21 );
7786 List <Integer > expected = List .of (0x47 , 0xb8 , 0x99 , 0xac , 0x17 , 0xa0 , 0x84 );
@@ -81,6 +90,7 @@ public void calculateTransmitSequencesSixByteMessage() {
8190
8291 @ Disabled ("Remove to run test" )
8392 @ Test
93+ @ DisplayName ("at 7 bytes long, no padding is required" )
8494 public void calculateTransmitSequencesSevenByteMessage () {
8595 List <Integer > input = List .of (0x47 , 0x72 , 0x65 , 0x61 , 0x74 , 0x31 , 0x21 );
8696 List <Integer > expected = List .of (0x47 , 0xb8 , 0x99 , 0xac , 0x17 , 0xa0 , 0xc5 , 0x42 );
@@ -90,6 +100,7 @@ public void calculateTransmitSequencesSevenByteMessage() {
90100
91101 @ Disabled ("Remove to run test" )
92102 @ Test
103+ @ DisplayName ("eight byte message" )
93104 public void calculateTransmitSequencesEightByteMessage () {
94105 List <Integer > input = List .of (0xc0 , 0x01 , 0x13 , 0x37 , 0xc0 , 0xde , 0x21 , 0x21 );
95106 List <Integer > expected = List .of (0xc0 , 0x00 , 0x44 , 0x66 , 0x7d , 0x06 , 0x78 , 0x42 , 0x21 , 0x81 );
@@ -99,6 +110,7 @@ public void calculateTransmitSequencesEightByteMessage() {
99110
100111 @ Disabled ("Remove to run test" )
101112 @ Test
113+ @ DisplayName ("twenty byte message" )
102114 public void calculateTransmitSequencesTwentyByteMessage () {
103115 List <Integer > input = List .of (
104116 0x45 , 0x78 , 0x65 , 0x72 , 0x63 , 0x69 , 0x73 , 0x6d , 0x20 , 0x69 ,
@@ -113,6 +125,7 @@ public void calculateTransmitSequencesTwentyByteMessage() {
113125
114126 @ Disabled ("Remove to run test" )
115127 @ Test
128+ @ DisplayName ("empty message" )
116129 public void decodeReceivedMessagesEmptyMessage () {
117130 List <Integer > input = List .of ();
118131 List <Integer > expected = List .of ();
@@ -122,6 +135,7 @@ public void decodeReceivedMessagesEmptyMessage() {
122135
123136 @ Disabled ("Remove to run test" )
124137 @ Test
138+ @ DisplayName ("zero message" )
125139 public void decodeReceivedMessagesZeroMessage () {
126140 List <Integer > input = List .of (0x00 , 0x00 );
127141 List <Integer > expected = List .of (0x00 );
@@ -131,6 +145,7 @@ public void decodeReceivedMessagesZeroMessage() {
131145
132146 @ Disabled ("Remove to run test" )
133147 @ Test
148+ @ DisplayName ("0x0300 is decoded to 0x02" )
134149 public void decodeReceivedMessages0x0300IsDecodedTo0x02 () {
135150 List <Integer > input = List .of (0x03 , 0x00 );
136151 List <Integer > expected = List .of (0x02 );
@@ -140,6 +155,7 @@ public void decodeReceivedMessages0x0300IsDecodedTo0x02() {
140155
141156 @ Disabled ("Remove to run test" )
142157 @ Test
158+ @ DisplayName ("0x0581 is decoded to 0x05" )
143159 public void decodeReceivedMessages0x0581IsDecodedTo0x05 () {
144160 List <Integer > input = List .of (0x05 , 0x81 );
145161 List <Integer > expected = List .of (0x05 );
@@ -149,6 +165,7 @@ public void decodeReceivedMessages0x0581IsDecodedTo0x05() {
149165
150166 @ Disabled ("Remove to run test" )
151167 @ Test
168+ @ DisplayName ("0x2881 is decoded to 0x29" )
152169 public void decodeReceivedMessages0x2881IsDecodedTo0x29 () {
153170 List <Integer > input = List .of (0x28 , 0x81 );
154171 List <Integer > expected = List .of (0x29 );
@@ -158,6 +175,7 @@ public void decodeReceivedMessages0x2881IsDecodedTo0x29() {
158175
159176 @ Disabled ("Remove to run test" )
160177 @ Test
178+ @ DisplayName ("first byte has wrong parity" )
161179 public void decodeFirstByteWrongParity () {
162180 List <Integer > input = List .of (0x07 , 0x00 );
163181 assertThrows (IllegalArgumentException .class , ()
@@ -166,6 +184,7 @@ public void decodeFirstByteWrongParity() {
166184
167185 @ Disabled ("Remove to run test" )
168186 @ Test
187+ @ DisplayName ("second byte has wrong parity" )
169188 public void decodeSecondByteWrongParity () {
170189 List <Integer > input = List .of (0x03 , 0x68 );
171190 assertThrows (IllegalArgumentException .class , ()
@@ -174,6 +193,7 @@ public void decodeSecondByteWrongParity() {
174193
175194 @ Disabled ("Remove to run test" )
176195 @ Test
196+ @ DisplayName ("0xcf4b00 is decoded to 0xce94" )
177197 public void decode0xcf4b00To0xce94 () {
178198 List <Integer > input = List .of (0xcf , 0x4b , 0x00 );
179199 List <Integer > expected = List .of (0xce , 0x94 );
@@ -183,6 +203,7 @@ public void decode0xcf4b00To0xce94() {
183203
184204 @ Disabled ("Remove to run test" )
185205 @ Test
206+ @ DisplayName ("0xe2566500 is decoded to 0xe2ad90" )
186207 public void decode0xe2566500To0xe2ad90 () {
187208 List <Integer > input = List .of (0xe2 , 0x56 , 0x65 , 0x00 );
188209 List <Integer > expected = List .of (0xe2 , 0xad , 0x90 );
@@ -192,6 +213,7 @@ public void decode0xe2566500To0xe2ad90() {
192213
193214 @ Disabled ("Remove to run test" )
194215 @ Test
216+ @ DisplayName ("six byte message" )
195217 public void decodeSixByteMessage () {
196218 List <Integer > input = List .of (0x47 , 0xb8 , 0x99 , 0xac , 0x17 , 0xa0 , 0x84 );
197219 List <Integer > expected = List .of (0x47 , 0x72 , 0x65 , 0x61 , 0x74 , 0x21 );
@@ -201,6 +223,7 @@ public void decodeSixByteMessage() {
201223
202224 @ Disabled ("Remove to run test" )
203225 @ Test
226+ @ DisplayName ("seven byte message" )
204227 public void decodeSevenByteMessage () {
205228 List <Integer > input = List .of (0x47 , 0xb8 , 0x99 , 0xac , 0x17 , 0xa0 , 0xc5 , 0x42 );
206229 List <Integer > expected = List .of (0x47 , 0x72 , 0x65 , 0x61 , 0x74 , 0x31 , 0x21 );
@@ -210,6 +233,7 @@ public void decodeSevenByteMessage() {
210233
211234 @ Disabled ("Remove to run test" )
212235 @ Test
236+ @ DisplayName ("last byte has wrong parity" )
213237 public void decodeLastByteWrongParity () {
214238 List <Integer > input = List .of (0x47 , 0xb8 , 0x99 , 0xac , 0x17 , 0xa0 , 0xc5 , 0x43 );
215239 assertThrows (IllegalArgumentException .class , ()
@@ -218,6 +242,7 @@ public void decodeLastByteWrongParity() {
218242
219243 @ Disabled ("Remove to run test" )
220244 @ Test
245+ @ DisplayName ("eight byte message" )
221246 public void decodeEightByteMessage () {
222247 List <Integer > input = List .of (0xc0 , 0x00 , 0x44 , 0x66 , 0x7d , 0x06 , 0x78 , 0x42 , 0x21 , 0x81 );
223248 List <Integer > expected = List .of (0xc0 , 0x01 , 0x13 , 0x37 , 0xc0 , 0xde , 0x21 , 0x21 );
@@ -227,6 +252,7 @@ public void decodeEightByteMessage() {
227252
228253 @ Disabled ("Remove to run test" )
229254 @ Test
255+ @ DisplayName ("twenty byte message" )
230256 public void decodeTwentyByteMessage () {
231257 List <Integer > input = List .of (
232258 0x44 , 0xbd , 0x18 , 0xaf , 0x27 , 0x1b , 0xa5 , 0xe7 , 0x6c , 0x90 , 0x1b ,
@@ -240,6 +266,7 @@ public void decodeTwentyByteMessage() {
240266
241267 @ Disabled ("Remove to run test" )
242268 @ Test
269+ @ DisplayName ("wrong parity on 16th byte" )
243270 public void decodeWrongParityOn16thByte () {
244271 List <Integer > input = List .of (
245272 0x44 , 0xbd , 0x18 , 0xaf , 0x27 , 0x1b , 0xa5 , 0xe7 , 0x6c , 0x90 ,
0 commit comments