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.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/c/config.json +9 -0
- data/tracks/c/exercises/nucleotide-count/makefile +15 -0
- data/tracks/c/exercises/nucleotide-count/src/example.c +43 -0
- data/tracks/c/exercises/nucleotide-count/src/example.h +6 -0
- data/tracks/c/exercises/nucleotide-count/test/test_nucleotide_count.c +58 -0
- data/tracks/c/exercises/nucleotide-count/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/nucleotide-count/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/nucleotide-count/test/vendor/unity_internals.h +701 -0
- data/tracks/ceylon/README.md +2 -2
- data/tracks/csharp/.gitattributes +11 -0
- data/tracks/csharp/appveyor.yml +1 -4
- data/tracks/csharp/exercises/acronym/AcronymTest.cs +1 -1
- data/tracks/csharp/exercises/atbash-cipher/AtbashCipher.cs +8 -3
- data/tracks/csharp/exercises/atbash-cipher/AtbashCipherTest.cs +76 -0
- data/tracks/csharp/exercises/atbash-cipher/Example.cs +22 -23
- data/tracks/csharp/exercises/isogram/Example.cs +2 -2
- data/tracks/csharp/exercises/isogram/IsogramTest.cs +47 -15
- data/tracks/csharp/exercises/nth-prime/Example.cs +4 -1
- data/tracks/csharp/exercises/nth-prime/NthPrime.cs +1 -1
- data/tracks/csharp/exercises/nth-prime/NthPrimeTest.cs +29 -15
- data/tracks/csharp/exercises/perfect-numbers/Example.cs +14 -16
- data/tracks/csharp/exercises/perfect-numbers/PerfectNumbers.cs +2 -2
- data/tracks/csharp/exercises/perfect-numbers/PerfectNumbersTest.cs +78 -26
- data/tracks/csharp/exercises/pig-latin/PigLatinTest.cs +69 -24
- data/tracks/csharp/exercises/raindrops/Example.cs +1 -1
- data/tracks/csharp/exercises/raindrops/RaindropsTest.cs +93 -31
- data/tracks/csharp/exercises/roman-numerals/HINTS.md +2 -0
- data/tracks/csharp/exercises/roman-numerals/RomanNumeralsTest.cs +106 -23
- data/tracks/csharp/exercises/word-search/HINTS.md +6 -0
- data/tracks/csharp/generators/{TestClass.cs → Classes/TestClass.cs} +2 -1
- data/tracks/csharp/generators/{TestClassNameTransformer.cs → Classes/TestClassNameTransformer.cs} +1 -1
- data/tracks/csharp/generators/{TestClassRenderer.cs → Classes/TestClassRenderer.cs} +2 -1
- data/tracks/csharp/generators/Classes/TestedClassNameTransformer.cs +9 -0
- data/tracks/csharp/generators/{CanonicalData.cs → Data/CanonicalData.cs} +1 -1
- data/tracks/csharp/generators/{CanonicalDataCase.cs → Data/CanonicalDataCase.cs} +3 -3
- data/tracks/csharp/generators/{CanonicalDataCaseJsonConverter.cs → Data/CanonicalDataCaseJsonConverter.cs} +1 -1
- data/tracks/csharp/generators/{CanonicalDataCasesJsonConverter.cs → Data/CanonicalDataCasesJsonConverter.cs} +2 -2
- data/tracks/csharp/generators/{CanonicalDataParser.cs → Data/CanonicalDataParser.cs} +5 -5
- data/tracks/csharp/generators/{ExerciseCollection.cs → Data/ExerciseCollection.cs} +3 -3
- data/tracks/csharp/generators/Exercises/AcronymExercise.cs +20 -0
- data/tracks/csharp/generators/Exercises/AtbashCipherExercise.cs +20 -0
- data/tracks/csharp/generators/Exercises/BooleanExercise.cs +14 -0
- data/tracks/csharp/generators/Exercises/EqualityExercise.cs +14 -0
- data/tracks/csharp/generators/Exercises/Exercise.cs +59 -4
- data/tracks/csharp/generators/Exercises/IsogramExercise.cs +9 -0
- data/tracks/csharp/generators/Exercises/LeapExercise.cs +1 -4
- data/tracks/csharp/generators/Exercises/NthPrimeExercise.cs +25 -0
- data/tracks/csharp/generators/Exercises/PerfectNumbersExercise.cs +29 -0
- data/tracks/csharp/generators/Exercises/PigLatinExercise.cs +9 -0
- data/tracks/csharp/generators/Exercises/RaindropsExercise.cs +20 -0
- data/tracks/csharp/generators/Exercises/RomanNumeralsExercise.cs +30 -0
- data/tracks/csharp/generators/Helpers/StringExtensions.cs +8 -0
- data/tracks/csharp/generators/{To.cs → Helpers/To.cs} +4 -1
- data/tracks/csharp/generators/Methods/BooleanTestMethodGenerator.cs +32 -0
- data/tracks/csharp/generators/Methods/EqualityTestMethodGenerator.cs +25 -0
- data/tracks/csharp/generators/Methods/ExceptionTestMethodGenerator.cs +30 -0
- data/tracks/csharp/generators/{TestMethod.cs → Methods/TestMethod.cs} +6 -3
- data/tracks/csharp/generators/Methods/TestMethodData.cs +12 -0
- data/tracks/csharp/generators/Methods/TestMethodGenerator.cs +64 -0
- data/tracks/csharp/generators/Methods/TestMethodNameTransformer.cs +23 -0
- data/tracks/csharp/generators/Methods/TestMethodOptions.cs +13 -0
- data/tracks/csharp/generators/{TestMethodRenderer.cs → Methods/TestMethodRenderer.cs} +1 -1
- data/tracks/csharp/generators/{TestedMethodNameTransformer.cs → Methods/TestedMethodNameTransformer.cs} +1 -1
- data/tracks/csharp/generators/Methods/TestedMethodType.cs +9 -0
- data/tracks/csharp/generators/Program.cs +2 -0
- data/tracks/elixir/config.json +7 -0
- data/tracks/elixir/exercises/diffie-hellman/HINTS.md +10 -0
- data/tracks/elixir/exercises/diffie-hellman/diffie_hellman.exs +61 -0
- data/tracks/elixir/exercises/diffie-hellman/diffie_hellman_test.exs +99 -0
- data/tracks/elixir/exercises/diffie-hellman/example.exs +64 -0
- data/tracks/haskell/exercises/pov/src/POV.hs +2 -2
- data/tracks/haskell/exercises/pythagorean-triplet/src/Triplet.hs +6 -3
- data/tracks/haskell/exercises/queen-attack/src/Queens.hs +1 -1
- data/tracks/haskell/exercises/raindrops/src/Raindrops.hs +2 -1
- data/tracks/haskell/exercises/robot-name/src/Robot.hs +2 -2
- data/tracks/haskell/exercises/robot-simulator/src/Robot.hs +6 -6
- data/tracks/haskell/exercises/roman-numerals/src/Roman.hs +2 -1
- data/tracks/haskell/exercises/run-length-encoding/src/RunLength.hs +2 -2
- data/tracks/haskell/exercises/saddle-points/src/Matrix.hs +2 -1
- data/tracks/haskell/exercises/say/src/Say.hs +2 -1
- data/tracks/haskell/exercises/scrabble-score/src/Scrabble.hs +4 -2
- data/tracks/haskell/exercises/secret-handshake/src/SecretHandshake.hs +1 -1
- data/tracks/haskell/exercises/sgf-parsing/src/Sgf.hs +1 -1
- data/tracks/java/exercises/acronym/src/example/java/Acronym.java +11 -1
- data/tracks/java/exercises/acronym/src/test/java/AcronymTest.java +8 -9
- data/tracks/java/exercises/grade-school/src/test/java/SchoolTest.java +8 -2
- data/tracks/java/exercises/luhn/src/test/java/LuhnValidatorTest.java +20 -13
- data/tracks/java/exercises/robot-name/src/test/java/RobotTest.java +6 -1
- data/tracks/javascript/README.md +1 -1
- data/tracks/javascript/docs/TESTS.md +9 -1
- data/tracks/kotlin/exercises/luhn/src/example/kotlin/Luhn.kt +18 -26
- data/tracks/kotlin/exercises/luhn/src/test/kotlin/LuhnTest.kt +40 -38
- data/tracks/php/README.md +1 -1
- data/tracks/php/config.json +5 -0
- data/tracks/php/exercises/perfect-numbers/example.php +23 -0
- data/tracks/php/exercises/perfect-numbers/perfect-numbers_test.php +99 -0
- data/tracks/purescript/.travis.yml +1 -0
- data/tracks/purescript/bin/test.sh +33 -8
- data/tracks/purescript/config.json +7 -0
- data/tracks/purescript/exercises/meetup/bower.json +17 -0
- data/tracks/purescript/exercises/meetup/examples/src/Meetup.purs +37 -0
- data/tracks/purescript/exercises/meetup/src/Meetup.purs +11 -0
- data/tracks/purescript/exercises/meetup/test/Main.purs +395 -0
- data/tracks/python/README.md +7 -6
- data/tracks/python/docs/TOOLS.md +3 -3
- data/tracks/python/exercises/bracket-push/bracket_push_test.py +32 -15
- data/tracks/python/exercises/hamming/hamming_test.py +2 -0
- data/tracks/python/exercises/luhn/luhn_test.py +2 -0
- data/tracks/python/test/check-exercises.py +7 -1
- metadata +56 -20
- data/tracks/csharp/exercises/atbash-cipher/AtbashTest.cs +0 -17
- data/tracks/csharp/generators/BooleanTestMethod.cs +0 -36
- data/tracks/csharp/generators/TestMethodNameTransformer.cs +0 -11
- data/tracks/csharp/generators/TestedClassNameTransformer.cs +0 -11
- 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
|
-
[
|
6
|
-
|
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(
|
8
|
+
Assert.Equal("appleay", PigLatin.Translate("apple"));
|
14
9
|
}
|
15
10
|
|
16
|
-
[
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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(
|
68
|
+
Assert.Equal("atqay", PigLatin.Translate("qat"));
|
24
69
|
}
|
25
70
|
|
26
71
|
[Fact(Skip = "Remove to run test")]
|
27
|
-
public void
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
120
|
+
public void A_whole_phrase()
|
76
121
|
{
|
77
122
|
Assert.Equal("ickquay astfay unray", PigLatin.Translate("quick fast run"));
|
78
123
|
}
|
@@ -2,49 +2,111 @@ using Xunit;
|
|
2
2
|
|
3
3
|
public class RaindropsTest
|
4
4
|
{
|
5
|
-
[
|
6
|
-
|
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(
|
8
|
+
Assert.Equal("1", Raindrops.Convert(1));
|
12
9
|
}
|
13
10
|
|
14
|
-
[
|
15
|
-
|
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(
|
14
|
+
Assert.Equal("Pling", Raindrops.Convert(3));
|
21
15
|
}
|
22
16
|
|
23
|
-
[
|
24
|
-
|
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(
|
20
|
+
Assert.Equal("Plang", Raindrops.Convert(5));
|
30
21
|
}
|
31
22
|
|
32
|
-
[
|
33
|
-
|
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(
|
26
|
+
Assert.Equal("Plong", Raindrops.Convert(7));
|
39
27
|
}
|
40
28
|
|
41
|
-
[
|
42
|
-
|
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(
|
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
|
}
|
@@ -2,28 +2,111 @@ using Xunit;
|
|
2
2
|
|
3
3
|
public class RomanNumeralsTest
|
4
4
|
{
|
5
|
-
[
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
[
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
[
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
[
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
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,8 +1,8 @@
|
|
1
|
-
using
|
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
|
@@ -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
|
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
|
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
|
-
=>
|
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
|
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
|
+
}
|