|
|
@@ -21,62 +21,62 @@ public class SimpleCipherStepTwoTest {
|
|
21
|
21
|
cipherWithSetKey = new Cipher(key);
|
|
22
|
22
|
}
|
|
23
|
23
|
|
|
24
|
|
- @Ignore
|
|
|
24
|
+ @Ignore("Remove to run test")
|
|
25
|
25
|
@Test
|
|
26
|
26
|
public void cipherKeepsTheSubmittedKey() {
|
|
27
|
27
|
assertEquals(key, cipherWithSetKey.getKey());
|
|
28
|
28
|
}
|
|
29
|
29
|
|
|
30
|
|
- @Ignore
|
|
|
30
|
+ @Ignore("Remove to run test")
|
|
31
|
31
|
@Test
|
|
32
|
32
|
public void cipherThrowsWithEmptyKey() {
|
|
33
|
33
|
expectedException.expect(IllegalArgumentException.class);
|
|
34
|
34
|
new Cipher("");
|
|
35
|
35
|
}
|
|
36
|
36
|
|
|
37
|
|
- @Ignore
|
|
|
37
|
+ @Ignore("Remove to run test")
|
|
38
|
38
|
@Test
|
|
39
|
39
|
public void cipherCanEncodeWithGivenKey() {
|
|
40
|
40
|
String cipherText = "abcdefghij";
|
|
41
|
41
|
assertEquals(cipherText, cipherWithSetKey.encode("aaaaaaaaaa"));
|
|
42
|
42
|
}
|
|
43
|
43
|
|
|
44
|
|
- @Ignore
|
|
|
44
|
+ @Ignore("Remove to run test")
|
|
45
|
45
|
@Test
|
|
46
|
46
|
public void cipherCanDecodeWithGivenKey() {
|
|
47
|
47
|
String cipherText = "aaaaaaaaaa";
|
|
48
|
48
|
assertEquals(cipherText, cipherWithSetKey.decode("abcdefghij"));
|
|
49
|
49
|
}
|
|
50
|
50
|
|
|
51
|
|
- @Ignore
|
|
|
51
|
+ @Ignore("Remove to run test")
|
|
52
|
52
|
@Test
|
|
53
|
53
|
public void cipherIsReversibleGivenKey() {
|
|
54
|
54
|
String plainText = "abcdefghij";
|
|
55
|
55
|
assertEquals(plainText, cipherWithSetKey.decode(cipherWithSetKey.encode("abcdefghij")));
|
|
56
|
56
|
}
|
|
57
|
57
|
|
|
58
|
|
- @Ignore
|
|
|
58
|
+ @Ignore("Remove to run test")
|
|
59
|
59
|
@Test
|
|
60
|
60
|
public void cipherCanWrapEncode() {
|
|
61
|
61
|
String cipherText = "zabcdefghi";
|
|
62
|
62
|
assertEquals(cipherText, cipherWithSetKey.encode("zzzzzzzzzz"));
|
|
63
|
63
|
}
|
|
64
|
64
|
|
|
65
|
|
- @Ignore
|
|
|
65
|
+ @Ignore("Remove to run test")
|
|
66
|
66
|
@Test
|
|
67
|
67
|
public void cipherCanEncodeMessageThatIsShorterThanTheKey() {
|
|
68
|
68
|
String cipherText = "abcde";
|
|
69
|
69
|
assertEquals(cipherText, cipherWithSetKey.encode("aaaaa"));
|
|
70
|
70
|
}
|
|
71
|
71
|
|
|
72
|
|
- @Ignore
|
|
|
72
|
+ @Ignore("Remove to run test")
|
|
73
|
73
|
@Test
|
|
74
|
74
|
public void cipherCanDecodeMessageThatIsShorterThanTheKey() {
|
|
75
|
75
|
String cipherText = "aaaaa";
|
|
76
|
76
|
assertEquals(cipherText, cipherWithSetKey.decode("abcde"));
|
|
77
|
77
|
}
|
|
78
|
78
|
|
|
79
|
|
- @Ignore
|
|
|
79
|
+ @Ignore("Remove to run test")
|
|
80
|
80
|
@Test
|
|
81
|
81
|
public void cipherCanDoubleShiftEncode() {
|
|
82
|
82
|
String plainText = "iamapandabear";
|