trackler 2.0.8.24 → 2.0.8.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/c/config.json +9 -0
  4. data/tracks/c/exercises/nucleotide-count/makefile +15 -0
  5. data/tracks/c/exercises/nucleotide-count/src/example.c +43 -0
  6. data/tracks/c/exercises/nucleotide-count/src/example.h +6 -0
  7. data/tracks/c/exercises/nucleotide-count/test/test_nucleotide_count.c +58 -0
  8. data/tracks/c/exercises/nucleotide-count/test/vendor/unity.c +1300 -0
  9. data/tracks/c/exercises/nucleotide-count/test/vendor/unity.h +274 -0
  10. data/tracks/c/exercises/nucleotide-count/test/vendor/unity_internals.h +701 -0
  11. data/tracks/ceylon/README.md +2 -2
  12. data/tracks/csharp/.gitattributes +11 -0
  13. data/tracks/csharp/appveyor.yml +1 -4
  14. data/tracks/csharp/exercises/acronym/AcronymTest.cs +1 -1
  15. data/tracks/csharp/exercises/atbash-cipher/AtbashCipher.cs +8 -3
  16. data/tracks/csharp/exercises/atbash-cipher/AtbashCipherTest.cs +76 -0
  17. data/tracks/csharp/exercises/atbash-cipher/Example.cs +22 -23
  18. data/tracks/csharp/exercises/isogram/Example.cs +2 -2
  19. data/tracks/csharp/exercises/isogram/IsogramTest.cs +47 -15
  20. data/tracks/csharp/exercises/nth-prime/Example.cs +4 -1
  21. data/tracks/csharp/exercises/nth-prime/NthPrime.cs +1 -1
  22. data/tracks/csharp/exercises/nth-prime/NthPrimeTest.cs +29 -15
  23. data/tracks/csharp/exercises/perfect-numbers/Example.cs +14 -16
  24. data/tracks/csharp/exercises/perfect-numbers/PerfectNumbers.cs +2 -2
  25. data/tracks/csharp/exercises/perfect-numbers/PerfectNumbersTest.cs +78 -26
  26. data/tracks/csharp/exercises/pig-latin/PigLatinTest.cs +69 -24
  27. data/tracks/csharp/exercises/raindrops/Example.cs +1 -1
  28. data/tracks/csharp/exercises/raindrops/RaindropsTest.cs +93 -31
  29. data/tracks/csharp/exercises/roman-numerals/HINTS.md +2 -0
  30. data/tracks/csharp/exercises/roman-numerals/RomanNumeralsTest.cs +106 -23
  31. data/tracks/csharp/exercises/word-search/HINTS.md +6 -0
  32. data/tracks/csharp/generators/{TestClass.cs → Classes/TestClass.cs} +2 -1
  33. data/tracks/csharp/generators/{TestClassNameTransformer.cs → Classes/TestClassNameTransformer.cs} +1 -1
  34. data/tracks/csharp/generators/{TestClassRenderer.cs → Classes/TestClassRenderer.cs} +2 -1
  35. data/tracks/csharp/generators/Classes/TestedClassNameTransformer.cs +9 -0
  36. data/tracks/csharp/generators/{CanonicalData.cs → Data/CanonicalData.cs} +1 -1
  37. data/tracks/csharp/generators/{CanonicalDataCase.cs → Data/CanonicalDataCase.cs} +3 -3
  38. data/tracks/csharp/generators/{CanonicalDataCaseJsonConverter.cs → Data/CanonicalDataCaseJsonConverter.cs} +1 -1
  39. data/tracks/csharp/generators/{CanonicalDataCasesJsonConverter.cs → Data/CanonicalDataCasesJsonConverter.cs} +2 -2
  40. data/tracks/csharp/generators/{CanonicalDataParser.cs → Data/CanonicalDataParser.cs} +5 -5
  41. data/tracks/csharp/generators/{ExerciseCollection.cs → Data/ExerciseCollection.cs} +3 -3
  42. data/tracks/csharp/generators/Exercises/AcronymExercise.cs +20 -0
  43. data/tracks/csharp/generators/Exercises/AtbashCipherExercise.cs +20 -0
  44. data/tracks/csharp/generators/Exercises/BooleanExercise.cs +14 -0
  45. data/tracks/csharp/generators/Exercises/EqualityExercise.cs +14 -0
  46. data/tracks/csharp/generators/Exercises/Exercise.cs +59 -4
  47. data/tracks/csharp/generators/Exercises/IsogramExercise.cs +9 -0
  48. data/tracks/csharp/generators/Exercises/LeapExercise.cs +1 -4
  49. data/tracks/csharp/generators/Exercises/NthPrimeExercise.cs +25 -0
  50. data/tracks/csharp/generators/Exercises/PerfectNumbersExercise.cs +29 -0
  51. data/tracks/csharp/generators/Exercises/PigLatinExercise.cs +9 -0
  52. data/tracks/csharp/generators/Exercises/RaindropsExercise.cs +20 -0
  53. data/tracks/csharp/generators/Exercises/RomanNumeralsExercise.cs +30 -0
  54. data/tracks/csharp/generators/Helpers/StringExtensions.cs +8 -0
  55. data/tracks/csharp/generators/{To.cs → Helpers/To.cs} +4 -1
  56. data/tracks/csharp/generators/Methods/BooleanTestMethodGenerator.cs +32 -0
  57. data/tracks/csharp/generators/Methods/EqualityTestMethodGenerator.cs +25 -0
  58. data/tracks/csharp/generators/Methods/ExceptionTestMethodGenerator.cs +30 -0
  59. data/tracks/csharp/generators/{TestMethod.cs → Methods/TestMethod.cs} +6 -3
  60. data/tracks/csharp/generators/Methods/TestMethodData.cs +12 -0
  61. data/tracks/csharp/generators/Methods/TestMethodGenerator.cs +64 -0
  62. data/tracks/csharp/generators/Methods/TestMethodNameTransformer.cs +23 -0
  63. data/tracks/csharp/generators/Methods/TestMethodOptions.cs +13 -0
  64. data/tracks/csharp/generators/{TestMethodRenderer.cs → Methods/TestMethodRenderer.cs} +1 -1
  65. data/tracks/csharp/generators/{TestedMethodNameTransformer.cs → Methods/TestedMethodNameTransformer.cs} +1 -1
  66. data/tracks/csharp/generators/Methods/TestedMethodType.cs +9 -0
  67. data/tracks/csharp/generators/Program.cs +2 -0
  68. data/tracks/elixir/config.json +7 -0
  69. data/tracks/elixir/exercises/diffie-hellman/HINTS.md +10 -0
  70. data/tracks/elixir/exercises/diffie-hellman/diffie_hellman.exs +61 -0
  71. data/tracks/elixir/exercises/diffie-hellman/diffie_hellman_test.exs +99 -0
  72. data/tracks/elixir/exercises/diffie-hellman/example.exs +64 -0
  73. data/tracks/haskell/exercises/pov/src/POV.hs +2 -2
  74. data/tracks/haskell/exercises/pythagorean-triplet/src/Triplet.hs +6 -3
  75. data/tracks/haskell/exercises/queen-attack/src/Queens.hs +1 -1
  76. data/tracks/haskell/exercises/raindrops/src/Raindrops.hs +2 -1
  77. data/tracks/haskell/exercises/robot-name/src/Robot.hs +2 -2
  78. data/tracks/haskell/exercises/robot-simulator/src/Robot.hs +6 -6
  79. data/tracks/haskell/exercises/roman-numerals/src/Roman.hs +2 -1
  80. data/tracks/haskell/exercises/run-length-encoding/src/RunLength.hs +2 -2
  81. data/tracks/haskell/exercises/saddle-points/src/Matrix.hs +2 -1
  82. data/tracks/haskell/exercises/say/src/Say.hs +2 -1
  83. data/tracks/haskell/exercises/scrabble-score/src/Scrabble.hs +4 -2
  84. data/tracks/haskell/exercises/secret-handshake/src/SecretHandshake.hs +1 -1
  85. data/tracks/haskell/exercises/sgf-parsing/src/Sgf.hs +1 -1
  86. data/tracks/java/exercises/acronym/src/example/java/Acronym.java +11 -1
  87. data/tracks/java/exercises/acronym/src/test/java/AcronymTest.java +8 -9
  88. data/tracks/java/exercises/grade-school/src/test/java/SchoolTest.java +8 -2
  89. data/tracks/java/exercises/luhn/src/test/java/LuhnValidatorTest.java +20 -13
  90. data/tracks/java/exercises/robot-name/src/test/java/RobotTest.java +6 -1
  91. data/tracks/javascript/README.md +1 -1
  92. data/tracks/javascript/docs/TESTS.md +9 -1
  93. data/tracks/kotlin/exercises/luhn/src/example/kotlin/Luhn.kt +18 -26
  94. data/tracks/kotlin/exercises/luhn/src/test/kotlin/LuhnTest.kt +40 -38
  95. data/tracks/php/README.md +1 -1
  96. data/tracks/php/config.json +5 -0
  97. data/tracks/php/exercises/perfect-numbers/example.php +23 -0
  98. data/tracks/php/exercises/perfect-numbers/perfect-numbers_test.php +99 -0
  99. data/tracks/purescript/.travis.yml +1 -0
  100. data/tracks/purescript/bin/test.sh +33 -8
  101. data/tracks/purescript/config.json +7 -0
  102. data/tracks/purescript/exercises/meetup/bower.json +17 -0
  103. data/tracks/purescript/exercises/meetup/examples/src/Meetup.purs +37 -0
  104. data/tracks/purescript/exercises/meetup/src/Meetup.purs +11 -0
  105. data/tracks/purescript/exercises/meetup/test/Main.purs +395 -0
  106. data/tracks/python/README.md +7 -6
  107. data/tracks/python/docs/TOOLS.md +3 -3
  108. data/tracks/python/exercises/bracket-push/bracket_push_test.py +32 -15
  109. data/tracks/python/exercises/hamming/hamming_test.py +2 -0
  110. data/tracks/python/exercises/luhn/luhn_test.py +2 -0
  111. data/tracks/python/test/check-exercises.py +7 -1
  112. metadata +56 -20
  113. data/tracks/csharp/exercises/atbash-cipher/AtbashTest.cs +0 -17
  114. data/tracks/csharp/generators/BooleanTestMethod.cs +0 -36
  115. data/tracks/csharp/generators/TestMethodNameTransformer.cs +0 -11
  116. data/tracks/csharp/generators/TestedClassNameTransformer.cs +0 -11
  117. data/tracks/java/exercises/allergies/src/main/java/.keep +0 -0
@@ -2,77 +2,122 @@ using Xunit;
2
2
 
3
3
  public class PigLatinTest
4
4
  {
5
- [Theory]
6
- [InlineData("apple", "appleay")]
7
- [InlineData("ear", "earay")]
8
- [InlineData("igloo", "iglooay")]
9
- [InlineData("object", "objectay")]
10
- [InlineData("under", "underay")]
11
- public void Ay_is_added_to_words_that_start_with_vowels(string word, string expected)
5
+ [Fact]
6
+ public void Word_beginning_with_a()
12
7
  {
13
- Assert.Equal(expected, PigLatin.Translate(word));
8
+ Assert.Equal("appleay", PigLatin.Translate("apple"));
14
9
  }
15
10
 
16
- [Theory(Skip = "Remove to run test")]
17
- [InlineData("pig", "igpay")]
18
- [InlineData("koala", "oalakay")]
19
- [InlineData("yellow", "ellowyay")]
20
- [InlineData("xenon", "enonxay")]
21
- public void First_letter_and_ay_are_moved_to_the_end_of_words_that_start_with_consonants(string word, string expected)
11
+ [Fact(Skip = "Remove to run test")]
12
+ public void Word_beginning_with_e()
13
+ {
14
+ Assert.Equal("earay", PigLatin.Translate("ear"));
15
+ }
16
+
17
+ [Fact(Skip = "Remove to run test")]
18
+ public void Word_beginning_with_i()
19
+ {
20
+ Assert.Equal("iglooay", PigLatin.Translate("igloo"));
21
+ }
22
+
23
+ [Fact(Skip = "Remove to run test")]
24
+ public void Word_beginning_with_o()
25
+ {
26
+ Assert.Equal("objectay", PigLatin.Translate("object"));
27
+ }
28
+
29
+ [Fact(Skip = "Remove to run test")]
30
+ public void Word_beginning_with_u()
31
+ {
32
+ Assert.Equal("underay", PigLatin.Translate("under"));
33
+ }
34
+
35
+ [Fact(Skip = "Remove to run test")]
36
+ public void Word_beginning_with_a_vowel_and_followed_by_a_qu()
37
+ {
38
+ Assert.Equal("equalay", PigLatin.Translate("equal"));
39
+ }
40
+
41
+ [Fact(Skip = "Remove to run test")]
42
+ public void Word_beginning_with_p()
43
+ {
44
+ Assert.Equal("igpay", PigLatin.Translate("pig"));
45
+ }
46
+
47
+ [Fact(Skip = "Remove to run test")]
48
+ public void Word_beginning_with_k()
49
+ {
50
+ Assert.Equal("oalakay", PigLatin.Translate("koala"));
51
+ }
52
+
53
+ [Fact(Skip = "Remove to run test")]
54
+ public void Word_beginning_with_y()
55
+ {
56
+ Assert.Equal("ellowyay", PigLatin.Translate("yellow"));
57
+ }
58
+
59
+ [Fact(Skip = "Remove to run test")]
60
+ public void Word_beginning_with_x()
61
+ {
62
+ Assert.Equal("enonxay", PigLatin.Translate("xenon"));
63
+ }
64
+
65
+ [Fact(Skip = "Remove to run test")]
66
+ public void Word_beginning_with_q_without_a_following_u()
22
67
  {
23
- Assert.Equal(expected, PigLatin.Translate(word));
68
+ Assert.Equal("atqay", PigLatin.Translate("qat"));
24
69
  }
25
70
 
26
71
  [Fact(Skip = "Remove to run test")]
27
- public void Ch_is_treated_like_a_single_consonant()
72
+ public void Word_beginning_with_ch()
28
73
  {
29
74
  Assert.Equal("airchay", PigLatin.Translate("chair"));
30
75
  }
31
76
 
32
77
  [Fact(Skip = "Remove to run test")]
33
- public void Qu_is_treated_like_a_single_consonant()
78
+ public void Word_beginning_with_qu()
34
79
  {
35
80
  Assert.Equal("eenquay", PigLatin.Translate("queen"));
36
81
  }
37
82
 
38
83
  [Fact(Skip = "Remove to run test")]
39
- public void Qu_and_a_single_preceding_consonant_are_treated_like_a_single_consonant()
84
+ public void Word_beginning_with_qu_and_a_preceding_consonant()
40
85
  {
41
86
  Assert.Equal("aresquay", PigLatin.Translate("square"));
42
87
  }
43
88
 
44
89
  [Fact(Skip = "Remove to run test")]
45
- public void Th_is_treated_like_a_single_consonant()
90
+ public void Word_beginning_with_th()
46
91
  {
47
92
  Assert.Equal("erapythay", PigLatin.Translate("therapy"));
48
93
  }
49
94
 
50
95
  [Fact(Skip = "Remove to run test")]
51
- public void Thr_is_treated_like_a_single_consonant()
96
+ public void Word_beginning_with_thr()
52
97
  {
53
98
  Assert.Equal("ushthray", PigLatin.Translate("thrush"));
54
99
  }
55
100
 
56
101
  [Fact(Skip = "Remove to run test")]
57
- public void Sch_is_treated_like_a_single_consonant()
102
+ public void Word_beginning_with_sch()
58
103
  {
59
104
  Assert.Equal("oolschay", PigLatin.Translate("school"));
60
105
  }
61
106
 
62
107
  [Fact(Skip = "Remove to run test")]
63
- public void Yt_is_treated_like_a_single_vowel()
108
+ public void Word_beginning_with_yt()
64
109
  {
65
110
  Assert.Equal("yttriaay", PigLatin.Translate("yttria"));
66
111
  }
67
112
 
68
113
  [Fact(Skip = "Remove to run test")]
69
- public void Xr_is_treated_like_a_single_vowel()
114
+ public void Word_beginning_with_xr()
70
115
  {
71
116
  Assert.Equal("xrayay", PigLatin.Translate("xray"));
72
117
  }
73
118
 
74
119
  [Fact(Skip = "Remove to run test")]
75
- public void Phrases_are_translated()
120
+ public void A_whole_phrase()
76
121
  {
77
122
  Assert.Equal("ickquay astfay unray", PigLatin.Translate("quick fast run"));
78
123
  }
@@ -1,4 +1,4 @@
1
- public class Raindrops
1
+ public static class Raindrops
2
2
  {
3
3
  public static string Convert(int number)
4
4
  {
@@ -2,49 +2,111 @@ using Xunit;
2
2
 
3
3
  public class RaindropsTest
4
4
  {
5
- [Theory]
6
- [InlineData(1, "1")]
7
- [InlineData(52, "52")]
8
- [InlineData(12121, "12121")]
9
- public void Non_primes_pass_through(int number, string expected)
5
+ [Fact]
6
+ public void The_sound_for_1_is_1()
10
7
  {
11
- Assert.Equal(expected, Raindrops.Convert(number));
8
+ Assert.Equal("1", Raindrops.Convert(1));
12
9
  }
13
10
 
14
- [Theory(Skip = "Remove to run test")]
15
- [InlineData(3)]
16
- [InlineData(6)]
17
- [InlineData(9)]
18
- public void Numbers_containing_3_as_a_prime_factor_give_pling(int number)
11
+ [Fact(Skip = "Remove to run test")]
12
+ public void The_sound_for_3_is_pling()
19
13
  {
20
- Assert.Equal("Pling", Raindrops.Convert(number));
14
+ Assert.Equal("Pling", Raindrops.Convert(3));
21
15
  }
22
16
 
23
- [Theory(Skip = "Remove to run test")]
24
- [InlineData(5)]
25
- [InlineData(10)]
26
- [InlineData(25)]
27
- public void Numbers_containing_5_as_a_prime_factor_give_plang(int number)
17
+ [Fact(Skip = "Remove to run test")]
18
+ public void The_sound_for_5_is_plang()
28
19
  {
29
- Assert.Equal("Plang", Raindrops.Convert(number));
20
+ Assert.Equal("Plang", Raindrops.Convert(5));
30
21
  }
31
22
 
32
- [Theory(Skip = "Remove to run test")]
33
- [InlineData(7)]
34
- [InlineData(14)]
35
- [InlineData(49)]
36
- public void Numbers_containing_7_as_a_prime_factor_give_plong(int number)
23
+ [Fact(Skip = "Remove to run test")]
24
+ public void The_sound_for_7_is_plong()
37
25
  {
38
- Assert.Equal("Plong", Raindrops.Convert(number));
26
+ Assert.Equal("Plong", Raindrops.Convert(7));
39
27
  }
40
28
 
41
- [Theory(Skip = "Remove to run test")]
42
- [InlineData(15, "PlingPlang")]
43
- [InlineData(21, "PlingPlong")]
44
- [InlineData(35, "PlangPlong")]
45
- [InlineData(105, "PlingPlangPlong")]
46
- public void Numbers_containing_multiple_prime_factors_give_all_results_concatenated(int number, string expected)
29
+ [Fact(Skip = "Remove to run test")]
30
+ public void The_sound_for_6_is_pling_as_it_has_a_factor_3()
47
31
  {
48
- Assert.Equal(expected, Raindrops.Convert(number));
32
+ Assert.Equal("Pling", Raindrops.Convert(6));
33
+ }
34
+
35
+ [Fact(Skip = "Remove to run test")]
36
+ public void Number_2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base()
37
+ {
38
+ Assert.Equal("8", Raindrops.Convert(8));
39
+ }
40
+
41
+ [Fact(Skip = "Remove to run test")]
42
+ public void The_sound_for_9_is_pling_as_it_has_a_factor_3()
43
+ {
44
+ Assert.Equal("Pling", Raindrops.Convert(9));
45
+ }
46
+
47
+ [Fact(Skip = "Remove to run test")]
48
+ public void The_sound_for_10_is_plang_as_it_has_a_factor_5()
49
+ {
50
+ Assert.Equal("Plang", Raindrops.Convert(10));
51
+ }
52
+
53
+ [Fact(Skip = "Remove to run test")]
54
+ public void The_sound_for_14_is_plong_as_it_has_a_factor_of_7()
55
+ {
56
+ Assert.Equal("Plong", Raindrops.Convert(14));
57
+ }
58
+
59
+ [Fact(Skip = "Remove to run test")]
60
+ public void The_sound_for_15_is_pling_plang_as_it_has_factors_3_and_5()
61
+ {
62
+ Assert.Equal("PlingPlang", Raindrops.Convert(15));
63
+ }
64
+
65
+ [Fact(Skip = "Remove to run test")]
66
+ public void The_sound_for_21_is_pling_plong_as_it_has_factors_3_and_7()
67
+ {
68
+ Assert.Equal("PlingPlong", Raindrops.Convert(21));
69
+ }
70
+
71
+ [Fact(Skip = "Remove to run test")]
72
+ public void The_sound_for_25_is_plang_as_it_has_a_factor_5()
73
+ {
74
+ Assert.Equal("Plang", Raindrops.Convert(25));
75
+ }
76
+
77
+ [Fact(Skip = "Remove to run test")]
78
+ public void The_sound_for_27_is_pling_as_it_has_a_factor_3()
79
+ {
80
+ Assert.Equal("Pling", Raindrops.Convert(27));
81
+ }
82
+
83
+ [Fact(Skip = "Remove to run test")]
84
+ public void The_sound_for_35_is_plang_plong_as_it_has_factors_5_and_7()
85
+ {
86
+ Assert.Equal("PlangPlong", Raindrops.Convert(35));
87
+ }
88
+
89
+ [Fact(Skip = "Remove to run test")]
90
+ public void The_sound_for_49_is_plong_as_it_has_a_factor_7()
91
+ {
92
+ Assert.Equal("Plong", Raindrops.Convert(49));
93
+ }
94
+
95
+ [Fact(Skip = "Remove to run test")]
96
+ public void The_sound_for_52_is_52()
97
+ {
98
+ Assert.Equal("52", Raindrops.Convert(52));
99
+ }
100
+
101
+ [Fact(Skip = "Remove to run test")]
102
+ public void The_sound_for_105_is_pling_plang_plong_as_it_has_factors_3_5_and_7()
103
+ {
104
+ Assert.Equal("PlingPlangPlong", Raindrops.Convert(105));
105
+ }
106
+
107
+ [Fact(Skip = "Remove to run test")]
108
+ public void The_sound_for_3125_is_plang_as_it_has_a_factor_5()
109
+ {
110
+ Assert.Equal("Plang", Raindrops.Convert(3125));
49
111
  }
50
112
  }
@@ -0,0 +1,2 @@
1
+ ## Hints
2
+ This exercise requires you to write an extension method. For more information, see [this page](https://msdn.microsoft.com/en-us//library/bb383977.aspx).
@@ -2,28 +2,111 @@ using Xunit;
2
2
 
3
3
  public class RomanNumeralsTest
4
4
  {
5
- [Theory]
6
- [InlineData(0, "")]
7
- [InlineData(1, "I")]
8
- [InlineData(2, "II")]
9
- [InlineData(3, "III")]
10
- [InlineData(4, "IV")]
11
- [InlineData(5, "V")]
12
- [InlineData(6, "VI")]
13
- [InlineData(9, "IX")]
14
- [InlineData(27, "XXVII")]
15
- [InlineData(48, "XLVIII")]
16
- [InlineData(59, "LIX")]
17
- [InlineData(93, "XCIII")]
18
- [InlineData(141, "CXLI")]
19
- [InlineData(163, "CLXIII")]
20
- [InlineData(402, "CDII")]
21
- [InlineData(575, "DLXXV")]
22
- [InlineData(911, "CMXI")]
23
- [InlineData(1024, "MXXIV")]
24
- [InlineData(3000, "MMM")]
25
- public void Convert_roman_to_arabic_numerals(int arabicNumeral, string expected)
26
- {
27
- Assert.Equal(expected, arabicNumeral.ToRoman());
5
+ [Fact]
6
+ public void Number_1_is_a_single_i()
7
+ {
8
+ Assert.Equal("I", 1.ToRoman());
9
+ }
10
+
11
+ [Fact(Skip = "Remove to run test")]
12
+ public void Number_2_is_two_i_s()
13
+ {
14
+ Assert.Equal("II", 2.ToRoman());
15
+ }
16
+
17
+ [Fact(Skip = "Remove to run test")]
18
+ public void Number_3_is_three_i_s()
19
+ {
20
+ Assert.Equal("III", 3.ToRoman());
21
+ }
22
+
23
+ [Fact(Skip = "Remove to run test")]
24
+ public void Number_4_being_5_1_is_iv()
25
+ {
26
+ Assert.Equal("IV", 4.ToRoman());
27
+ }
28
+
29
+ [Fact(Skip = "Remove to run test")]
30
+ public void Number_5_is_a_single_v()
31
+ {
32
+ Assert.Equal("V", 5.ToRoman());
33
+ }
34
+
35
+ [Fact(Skip = "Remove to run test")]
36
+ public void Number_6_being_5_1_is_vi()
37
+ {
38
+ Assert.Equal("VI", 6.ToRoman());
39
+ }
40
+
41
+ [Fact(Skip = "Remove to run test")]
42
+ public void Number_9_being_10_1_is_ix()
43
+ {
44
+ Assert.Equal("IX", 9.ToRoman());
45
+ }
46
+
47
+ [Fact(Skip = "Remove to run test")]
48
+ public void Number_20_is_two_x_s()
49
+ {
50
+ Assert.Equal("XXVII", 27.ToRoman());
51
+ }
52
+
53
+ [Fact(Skip = "Remove to run test")]
54
+ public void Number_48_is_not_50_2_but_rather_40_8()
55
+ {
56
+ Assert.Equal("XLVIII", 48.ToRoman());
57
+ }
58
+
59
+ [Fact(Skip = "Remove to run test")]
60
+ public void Number_50_is_a_single_l()
61
+ {
62
+ Assert.Equal("LIX", 59.ToRoman());
63
+ }
64
+
65
+ [Fact(Skip = "Remove to run test")]
66
+ public void Number_90_being_100_10_is_xc()
67
+ {
68
+ Assert.Equal("XCIII", 93.ToRoman());
69
+ }
70
+
71
+ [Fact(Skip = "Remove to run test")]
72
+ public void Number_100_is_a_single_c()
73
+ {
74
+ Assert.Equal("CXLI", 141.ToRoman());
75
+ }
76
+
77
+ [Fact(Skip = "Remove to run test")]
78
+ public void Number_60_being_50_10_is_lx()
79
+ {
80
+ Assert.Equal("CLXIII", 163.ToRoman());
81
+ }
82
+
83
+ [Fact(Skip = "Remove to run test")]
84
+ public void Number_400_being_500_100_is_cd()
85
+ {
86
+ Assert.Equal("CDII", 402.ToRoman());
87
+ }
88
+
89
+ [Fact(Skip = "Remove to run test")]
90
+ public void Number_500_is_a_single_d()
91
+ {
92
+ Assert.Equal("DLXXV", 575.ToRoman());
93
+ }
94
+
95
+ [Fact(Skip = "Remove to run test")]
96
+ public void Number_900_being_1000_100_is_cm()
97
+ {
98
+ Assert.Equal("CMXI", 911.ToRoman());
99
+ }
100
+
101
+ [Fact(Skip = "Remove to run test")]
102
+ public void Number_1000_is_a_single_m()
103
+ {
104
+ Assert.Equal("MXXIV", 1024.ToRoman());
105
+ }
106
+
107
+ [Fact(Skip = "Remove to run test")]
108
+ public void Number_3000_is_three_m_s()
109
+ {
110
+ Assert.Equal("MMM", 3000.ToRoman());
28
111
  }
29
112
  }
@@ -0,0 +1,6 @@
1
+ ## HINTS
2
+
3
+ One of the uses of Tuples is returning multiple values from a function. In this exercise, write
4
+ a function that returns a Tuple (the x- and y- part of a coordinate).
5
+
6
+ For more information on Tuples, see [this link](https://msdn.microsoft.com/en-us/library/system.tuple(v=vs.110).aspx).
@@ -1,6 +1,7 @@
1
1
  using System.Collections.Generic;
2
+ using Generators.Methods;
2
3
 
3
- namespace Generators
4
+ namespace Generators.Classes
4
5
  {
5
6
  public class TestClass
6
7
  {
@@ -1,6 +1,6 @@
1
1
  using Humanizer;
2
2
 
3
- namespace Generators
3
+ namespace Generators.Classes
4
4
  {
5
5
  public class TestClassNameTransformer : IStringTransformer
6
6
  {
@@ -1,7 +1,8 @@
1
1
  using System.Collections.Generic;
2
2
  using System.Linq;
3
+ using Generators.Methods;
3
4
 
4
- namespace Generators
5
+ namespace Generators.Classes
5
6
  {
6
7
  public static class TestClassRenderer
7
8
  {
@@ -0,0 +1,9 @@
1
+ using Humanizer;
2
+
3
+ namespace Generators.Classes
4
+ {
5
+ public class TestedClassNameTransformer : IStringTransformer
6
+ {
7
+ public string Transform(string input) => input.Dehumanize();
8
+ }
9
+ }
@@ -1,7 +1,7 @@
1
1
  using System.ComponentModel.DataAnnotations;
2
2
  using Newtonsoft.Json;
3
3
 
4
- namespace Generators
4
+ namespace Generators.Data
5
5
  {
6
6
  public class CanonicalData
7
7
  {
@@ -1,8 +1,8 @@
1
- using Newtonsoft.Json;
2
- using System.Collections.Generic;
1
+ using System.Collections.Generic;
3
2
  using System.ComponentModel.DataAnnotations;
3
+ using Newtonsoft.Json;
4
4
 
5
- namespace Generators
5
+ namespace Generators.Data
6
6
  {
7
7
  [JsonConverter(typeof(CanonicalDataCaseJsonConverter))]
8
8
  public class CanonicalDataCase
@@ -3,7 +3,7 @@ using System.Collections.Generic;
3
3
  using Newtonsoft.Json;
4
4
  using Newtonsoft.Json.Linq;
5
5
 
6
- namespace Generators
6
+ namespace Generators.Data
7
7
  {
8
8
  public class CanonicalDataCaseJsonConverter : JsonConverter
9
9
  {
@@ -1,11 +1,11 @@
1
1
  using System;
2
2
  using System.Collections.Generic;
3
+ using System.Linq;
3
4
  using System.Reflection;
4
5
  using Newtonsoft.Json;
5
6
  using Newtonsoft.Json.Linq;
6
- using System.Linq;
7
7
 
8
- namespace Generators
8
+ namespace Generators.Data
9
9
  {
10
10
  public class CanonicalDataCasesJsonConverter : JsonConverter
11
11
  {
@@ -1,13 +1,13 @@
1
- using Newtonsoft.Json;
2
- using System;
1
+ using System;
3
2
  using System.ComponentModel.DataAnnotations;
4
3
  using System.Net.Http;
4
+ using Newtonsoft.Json;
5
5
 
6
- namespace Generators
6
+ namespace Generators.Data
7
7
  {
8
8
  public static class CanonicalDataParser
9
9
  {
10
- private static readonly HttpClient httpClient = new HttpClient();
10
+ private static readonly HttpClient HttpClient = new HttpClient();
11
11
 
12
12
  public static CanonicalData Parse(string exercise)
13
13
  {
@@ -20,7 +20,7 @@ namespace Generators
20
20
  }
21
21
 
22
22
  private static string DownloadCanonicalDataJson(string exercise)
23
- => httpClient.GetStringAsync(GetCanonicalDataUrl(exercise)).GetAwaiter().GetResult();
23
+ => HttpClient.GetStringAsync(GetCanonicalDataUrl(exercise)).GetAwaiter().GetResult();
24
24
 
25
25
  private static Uri GetCanonicalDataUrl(string exercise)
26
26
  => new Uri($"https://raw.githubusercontent.com/exercism/x-common/master/exercises/{exercise}/canonical-data.json");
@@ -1,11 +1,11 @@
1
- using Generators.Exercises;
2
- using System;
1
+ using System;
3
2
  using System.Collections;
4
3
  using System.Collections.Generic;
5
4
  using System.Linq;
6
5
  using System.Reflection;
6
+ using Generators.Exercises;
7
7
 
8
- namespace Generators
8
+ namespace Generators.Data
9
9
  {
10
10
  public class ExerciseCollection : IEnumerable<Exercise>
11
11
  {
@@ -0,0 +1,20 @@
1
+ using Generators.Data;
2
+ using Generators.Methods;
3
+
4
+ namespace Generators.Exercises
5
+ {
6
+ public class AcronymExercise : EqualityExercise
7
+ {
8
+ public AcronymExercise() : base("acronym")
9
+ {
10
+ }
11
+
12
+ protected override TestMethodData CreateTestMethodData(CanonicalData canonicalData, CanonicalDataCase canonicalDataCase, int index)
13
+ {
14
+ var testMethodData = base.CreateTestMethodData(canonicalData, canonicalDataCase, index);
15
+ testMethodData.Options.InputProperty = "phrase";
16
+
17
+ return testMethodData;
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ using Generators.Data;
2
+ using Generators.Methods;
3
+
4
+ namespace Generators.Exercises
5
+ {
6
+ public class AtbashCipherExercise : EqualityExercise
7
+ {
8
+ public AtbashCipherExercise() : base("atbash-cipher")
9
+ {
10
+ }
11
+
12
+ protected override TestMethodOptions CreateTestMethodOptions(CanonicalData canonicalData, CanonicalDataCase canonicalDataCase, int index)
13
+ {
14
+ var testMethodOptions = base.CreateTestMethodOptions(canonicalData, canonicalDataCase, index);
15
+ testMethodOptions.InputProperty = "phrase";
16
+
17
+ return testMethodOptions;
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,14 @@
1
+ using Generators.Methods;
2
+
3
+ namespace Generators.Exercises
4
+ {
5
+ public abstract class BooleanExercise : Exercise
6
+ {
7
+ protected BooleanExercise(string name) : base(name)
8
+ {
9
+ }
10
+
11
+ protected override TestMethod CreateTestMethod(TestMethodData testMethodData)
12
+ => CreateBooleanTestMethod(testMethodData);
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ using Generators.Methods;
2
+
3
+ namespace Generators.Exercises
4
+ {
5
+ public abstract class EqualityExercise : Exercise
6
+ {
7
+ protected EqualityExercise(string name) : base(name)
8
+ {
9
+ }
10
+
11
+ protected override TestMethod CreateTestMethod(TestMethodData testMethodData)
12
+ => CreateEqualityTestMethod(testMethodData);
13
+ }
14
+ }