|
4 | 4 | public class AffineCipherTests |
5 | 5 | { |
6 | 6 | [Fact] |
7 | | - public void Encode_yes() |
8 | | - { |
9 | | - Assert.Equal("xbt", AffineCipher.Encode("yes", 5, 7)); |
10 | | - } |
11 | | - |
12 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
13 | | - public void Encode_no() |
14 | | - { |
15 | | - Assert.Equal("fu", AffineCipher.Encode("no", 15, 18)); |
16 | | - } |
17 | | - |
18 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
19 | | - public void Encode_omg() |
20 | | - { |
21 | | - Assert.Equal("lvz", AffineCipher.Encode("OMG", 21, 3)); |
22 | | - } |
23 | | - |
24 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
25 | | - public void Encode_o_m_g() |
26 | | - { |
27 | | - Assert.Equal("hjp", AffineCipher.Encode("O M G", 25, 47)); |
28 | | - } |
29 | | - |
30 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
31 | | - public void Encode_mindblowingly() |
32 | | - { |
33 | | - Assert.Equal("rzcwa gnxzc dgt", AffineCipher.Encode("mindblowingly", 11, 15)); |
34 | | - } |
35 | | - |
36 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
37 | | - public void Encode_numbers() |
38 | | - { |
39 | | - Assert.Equal("jqgjc rw123 jqgjc rw", AffineCipher.Encode("Testing,1 2 3, testing.", 3, 4)); |
40 | | - } |
41 | | - |
42 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
43 | | - public void Encode_deep_thought() |
44 | | - { |
45 | | - Assert.Equal("iynia fdqfb ifje", AffineCipher.Encode("Truth is fiction.", 5, 17)); |
46 | | - } |
47 | | - |
48 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
49 | | - public void Encode_all_the_letters() |
50 | | - { |
51 | | - Assert.Equal("swxtj npvyk lruol iejdc blaxk swxmh qzglf", AffineCipher.Encode("The quick brown fox jumps over the lazy dog.", 17, 33)); |
52 | | - } |
53 | | - |
54 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
55 | | - public void Encode_with_a_not_coprime_to_m() |
56 | | - { |
57 | | - Assert.Throws<ArgumentException>(() => AffineCipher.Encode("This is a test.", 6, 17)); |
58 | | - } |
59 | | - |
60 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
61 | | - public void Decode_exercism() |
62 | | - { |
63 | | - Assert.Equal("exercism", AffineCipher.Decode("tytgn fjr", 3, 7)); |
64 | | - } |
65 | | - |
66 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
67 | | - public void Decode_a_sentence() |
68 | | - { |
69 | | - Assert.Equal("anobstacleisoftenasteppingstone", AffineCipher.Decode("qdwju nqcro muwhn odqun oppmd aunwd o", 19, 16)); |
70 | | - } |
71 | | - |
72 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
73 | | - public void Decode_numbers() |
74 | | - { |
75 | | - Assert.Equal("testing123testing", AffineCipher.Decode("odpoz ub123 odpoz ub", 25, 7)); |
76 | | - } |
77 | | - |
78 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
79 | | - public void Decode_all_the_letters() |
80 | | - { |
81 | | - Assert.Equal("thequickbrownfoxjumpsoverthelazydog", AffineCipher.Decode("swxtj npvyk lruol iejdc blaxk swxmh qzglf", 17, 33)); |
82 | | - } |
83 | | - |
84 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
85 | | - public void Decode_with_no_spaces_in_input() |
86 | | - { |
87 | | - Assert.Equal("thequickbrownfoxjumpsoverthelazydog", AffineCipher.Decode("swxtjnpvyklruoliejdcblaxkswxmhqzglf", 17, 33)); |
88 | | - } |
89 | | - |
90 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
91 | | - public void Decode_with_too_many_spaces() |
92 | | - { |
93 | | - Assert.Equal("jollygreengiant", AffineCipher.Decode("vszzm cly yd cg qdp", 15, 16)); |
94 | | - } |
95 | | - |
96 | | - [Fact(Skip = "Remove this Skip property to run this test")] |
97 | | - public void Decode_with_a_not_coprime_to_m() |
98 | | - { |
99 | | - Assert.Throws<ArgumentException>(() => AffineCipher.Decode("Test", 13, 5)); |
100 | | - } |
| 7 | + public void () { |
| 8 | + Assert.Equal( "xbt" , AffineCipher.Encode( "yes" , 5 , 7 ) ) ; } |
| 9 | + |
| 10 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 11 | +public void () |
| 12 | +{ |
| 13 | + Assert.Equal("fu", AffineCipher.Encode("no", 15, 18)); |
| 14 | +} |
| 15 | + |
| 16 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 17 | +public void () |
| 18 | +{ |
| 19 | + Assert.Equal("lvz", AffineCipher.Encode("OMG", 21, 3)); |
| 20 | +} |
| 21 | + |
| 22 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 23 | +public void () |
| 24 | +{ |
| 25 | + Assert.Equal("hjp", AffineCipher.Encode("O M G", 25, 47)); |
| 26 | +} |
| 27 | + |
| 28 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 29 | +public void () |
| 30 | +{ |
| 31 | + Assert.Equal("rzcwa gnxzc dgt", AffineCipher.Encode("mindblowingly", 11, 15)); |
| 32 | +} |
| 33 | + |
| 34 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 35 | +public void () |
| 36 | +{ |
| 37 | + Assert.Equal("jqgjc rw123 jqgjc rw", AffineCipher.Encode("Testing,1 2 3, testing.", 3, 4)); |
| 38 | +} |
| 39 | + |
| 40 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 41 | +public void () |
| 42 | +{ |
| 43 | + Assert.Equal("iynia fdqfb ifje", AffineCipher.Encode("Truth is fiction.", 5, 17)); |
| 44 | +} |
| 45 | + |
| 46 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 47 | +public void () |
| 48 | +{ |
| 49 | + Assert.Equal("swxtj npvyk lruol iejdc blaxk swxmh qzglf", AffineCipher.Encode("The quick brown fox jumps over the lazy dog.", 17, 33)); |
| 50 | +} |
| 51 | + |
| 52 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 53 | +public void () |
| 54 | +{ |
| 55 | + Assert.Throws<ArgumentException>(() => AffineCipher.Encode("This is a test.", 6, 17)); |
| 56 | +} |
| 57 | + |
| 58 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 59 | +public void () |
| 60 | +{ |
| 61 | + Assert.Equal("exercism", AffineCipher.Decode(tytgn fjr, 3, 7)); |
| 62 | +} |
| 63 | + |
| 64 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 65 | +public void () |
| 66 | +{ |
| 67 | + Assert.Equal("anobstacleisoftenasteppingstone", AffineCipher.Decode(qdwju nqcro muwhn odqun oppmd aunwd o, 19, 16)); |
| 68 | +} |
| 69 | + |
| 70 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 71 | +public void () |
| 72 | +{ |
| 73 | + Assert.Equal("testing123testing", AffineCipher.Decode(odpoz ub123 odpoz ub, 25, 7)); |
| 74 | +} |
| 75 | + |
| 76 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 77 | +public void () |
| 78 | +{ |
| 79 | + Assert.Equal("thequickbrownfoxjumpsoverthelazydog", AffineCipher.Decode(swxtj npvyk lruol iejdc blaxk swxmh qzglf, 17, 33)); |
| 80 | +} |
| 81 | + |
| 82 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 83 | +public void () |
| 84 | +{ |
| 85 | + Assert.Equal("thequickbrownfoxjumpsoverthelazydog", AffineCipher.Decode(swxtjnpvyklruoliejdcblaxkswxmhqzglf, 17, 33)); |
101 | 86 | } |
| 87 | + |
| 88 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 89 | +public void () |
| 90 | +{ |
| 91 | + Assert.Equal("jollygreengiant", AffineCipher.Decode(vszzm cly yd cg qdp, 15, 16)); |
| 92 | +} |
| 93 | + |
| 94 | +[Fact(Skip = "Remove this Skip property to run this test")] |
| 95 | +public void () |
| 96 | +{ |
| 97 | + Assert.Throws<ArgumentException>(() => AffineCipher.Decode("Test", 13, 5)); |
| 98 | +} } |
| 99 | + |
0 commit comments