trackler 2.2.1.12 → 2.2.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/space-age/description.md +2 -1
  4. data/problem-specifications/exercises/two-fer/canonical-data.json +4 -4
  5. data/tracks/csharp/.gitignore +2 -1
  6. data/tracks/csharp/config/maintainers.json +3 -3
  7. data/tracks/csharp/exercises/collatz-conjecture/CollatzConjecture.cs +1 -1
  8. data/tracks/csharp/exercises/collatz-conjecture/CollatzConjectureTest.cs +8 -8
  9. data/tracks/csharp/exercises/collatz-conjecture/Example.cs +6 -6
  10. data/tracks/csharp/exercises/gigasecond/Example.cs +1 -1
  11. data/tracks/csharp/exercises/gigasecond/Gigasecond.cs +1 -1
  12. data/tracks/csharp/exercises/gigasecond/GigasecondTest.cs +21 -10
  13. data/tracks/csharp/exercises/hamming/Example.cs +6 -1
  14. data/tracks/csharp/exercises/hamming/Hamming.cs +1 -1
  15. data/tracks/csharp/exercises/hamming/HammingTest.cs +69 -12
  16. data/tracks/csharp/exercises/pangram/PangramTest.cs +15 -20
  17. data/tracks/csharp/exercises/phone-number/Example.cs +15 -42
  18. data/tracks/csharp/exercises/phone-number/PhoneNumber.cs +2 -17
  19. data/tracks/csharp/exercises/phone-number/PhoneNumberTest.cs +57 -20
  20. data/tracks/csharp/exercises/prime-factors/Example.cs +1 -1
  21. data/tracks/csharp/exercises/prime-factors/PrimeFactors.cs +1 -1
  22. data/tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs +16 -38
  23. data/tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs +21 -19
  24. data/tracks/csharp/exercises/rna-transcription/Example.cs +7 -2
  25. data/tracks/csharp/exercises/rna-transcription/RnaTranscription.cs +2 -2
  26. data/tracks/csharp/exercises/rna-transcription/RnaTranscriptionTest.cs +26 -6
  27. data/tracks/csharp/exercises/rotational-cipher/RotationalCipherTest.cs +7 -7
  28. data/tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs +53 -29
  29. data/tracks/csharp/exercises/scrabble-score/Example.cs +2 -2
  30. data/tracks/csharp/exercises/scrabble-score/ScrabbleScore.cs +1 -1
  31. data/tracks/csharp/exercises/scrabble-score/ScrabbleScoreTest.cs +33 -19
  32. data/tracks/csharp/exercises/secret-handshake/SecretHandshake.cs +0 -1
  33. data/tracks/csharp/exercises/secret-handshake/SecretHandshakeTest.cs +36 -10
  34. data/tracks/csharp/exercises/two-fer/Example.cs +1 -1
  35. data/tracks/csharp/exercises/two-fer/TwoFer.cs +1 -1
  36. data/tracks/csharp/exercises/two-fer/TwoFerTest.cs +19 -19
  37. data/tracks/csharp/generators/.gitignore +1 -1
  38. data/tracks/csharp/generators/Exercise.cs +85 -10
  39. data/tracks/csharp/generators/Exercises/AllYourBase.cs +3 -14
  40. data/tracks/csharp/generators/Exercises/Allergies.cs +21 -18
  41. data/tracks/csharp/generators/Exercises/Alphametics.cs +6 -7
  42. data/tracks/csharp/generators/Exercises/Anagram.cs +4 -4
  43. data/tracks/csharp/generators/Exercises/BeerSong.cs +4 -2
  44. data/tracks/csharp/generators/Exercises/BinarySearch.cs +3 -3
  45. data/tracks/csharp/generators/Exercises/BookStore.cs +3 -3
  46. data/tracks/csharp/generators/Exercises/BracketPush.cs +4 -2
  47. data/tracks/csharp/generators/Exercises/CollatzConjecture.cs +16 -0
  48. data/tracks/csharp/generators/Exercises/ConvertExtensions.cs +12 -0
  49. data/tracks/csharp/generators/Exercises/CryptoSquare.cs +3 -2
  50. data/tracks/csharp/generators/Exercises/FoodChain.cs +3 -3
  51. data/tracks/csharp/generators/Exercises/Gigasecond.cs +38 -0
  52. data/tracks/csharp/generators/Exercises/Hamming.cs +16 -0
  53. data/tracks/csharp/generators/Exercises/Leap.cs +4 -2
  54. data/tracks/csharp/generators/Exercises/Luhn.cs +3 -1
  55. data/tracks/csharp/generators/Exercises/NthPrime.cs +2 -10
  56. data/tracks/csharp/generators/Exercises/Pangram.cs +17 -0
  57. data/tracks/csharp/generators/Exercises/PerfectNumbers.cs +2 -9
  58. data/tracks/csharp/generators/Exercises/PhoneNumber.cs +15 -0
  59. data/tracks/csharp/generators/Exercises/PrimeFactors.cs +6 -0
  60. data/tracks/csharp/generators/Exercises/RailFenceCipher.cs +23 -0
  61. data/tracks/csharp/generators/Exercises/RnaTranscription.cs +6 -0
  62. data/tracks/csharp/generators/Exercises/RomanNumerals.cs +4 -2
  63. data/tracks/csharp/generators/Exercises/RunLengthEncoding.cs +40 -0
  64. data/tracks/csharp/generators/Exercises/ScrabbleScore.cs +6 -0
  65. data/tracks/csharp/generators/Exercises/SecretHandshake.cs +15 -0
  66. data/tracks/csharp/generators/Exercises/Transpose.cs +4 -4
  67. data/tracks/csharp/generators/Exercises/TwoFer.cs +6 -0
  68. data/tracks/csharp/generators/Exercises/Wordy.cs +2 -10
  69. data/tracks/csharp/generators/Generators.csproj +1 -3
  70. data/tracks/csharp/generators/Input/CanonicalDataFile.cs +48 -11
  71. data/tracks/csharp/generators/Input/CanonicalDataOptions.cs +8 -0
  72. data/tracks/csharp/generators/Input/CanonicalDataParser.cs +11 -3
  73. data/tracks/csharp/generators/Options.cs +8 -0
  74. data/tracks/csharp/generators/Output/{TestClassFile.cs → ExerciseWriter.cs} +4 -3
  75. data/tracks/csharp/generators/Output/FormattingExtensions.cs +14 -0
  76. data/tracks/csharp/generators/Output/IndentFilter.cs +13 -0
  77. data/tracks/csharp/generators/Output/TemplateRenderer.cs +23 -0
  78. data/tracks/csharp/generators/Output/Templates/_Act.liquid +1 -0
  79. data/tracks/csharp/generators/Output/Templates/_Arrange.liquid +3 -0
  80. data/tracks/csharp/generators/Output/Templates/_AssertBoolean.liquid +1 -0
  81. data/tracks/csharp/generators/Output/Templates/_AssertEqual.liquid +1 -0
  82. data/tracks/csharp/generators/Output/Templates/_AssertEqual_Empty.liquid +1 -0
  83. data/tracks/csharp/generators/Output/Templates/_AssertNull.liquid +1 -0
  84. data/tracks/csharp/generators/Output/Templates/_AssertThrowsException.liquid +1 -0
  85. data/tracks/csharp/generators/Output/{TestClass.liquid → Templates/_TestClass.liquid} +2 -8
  86. data/tracks/csharp/generators/Output/Templates/_TestMethod.liquid +5 -0
  87. data/tracks/csharp/generators/Output/Templates/_TestMethodBody.liquid +3 -0
  88. data/tracks/csharp/generators/Output/TestClass.cs +5 -2
  89. data/tracks/csharp/generators/Output/TestMethod.cs +6 -6
  90. data/tracks/csharp/generators/Output/TestMethodBody.cs +49 -0
  91. data/tracks/csharp/generators/Output/TestMethodBodyData.cs +85 -0
  92. data/tracks/csharp/generators/Output/TestMethodBodyWithBooleanCheck.cs +16 -0
  93. data/tracks/csharp/generators/Output/TestMethodBodyWithEqualityCheck.cs +21 -0
  94. data/tracks/csharp/generators/Output/TestMethodBodyWithExceptionCheck.cs +18 -0
  95. data/tracks/csharp/generators/Output/TestMethodBodyWithNullCheck.cs +13 -0
  96. data/tracks/csharp/generators/Output/UnescapedValue.cs +6 -2
  97. data/tracks/csharp/generators/Output/ValueFormatter.cs +1 -10
  98. data/tracks/csharp/generators/Program.cs +34 -8
  99. data/tracks/delphi/config/maintainers.json +1 -1
  100. data/tracks/delphi/docs/{Getting_Started_Guide.md → GETTING_STARTED_GUIDE.md} +0 -0
  101. data/tracks/fsharp/config.json +16 -5
  102. data/tracks/fsharp/config/maintainers.json +3 -3
  103. data/tracks/fsharp/exercises/two-fer/Example.fs +4 -0
  104. data/tracks/fsharp/exercises/two-fer/README.md +28 -0
  105. data/tracks/fsharp/exercises/two-fer/TwoFerTest.fs +19 -0
  106. data/tracks/groovy/CONTRIBUTING.md +19 -0
  107. data/tracks/groovy/README.md +10 -2
  108. data/tracks/java/exercises/allergies/src/example/java/Allergies.java +1 -1
  109. data/tracks/r/bin/run_tests.R +1 -4
  110. data/tracks/r/docs/{snippet.txt → SNIPPET.txt} +0 -0
  111. data/tracks/r/exercises/hamming/example.R +1 -1
  112. data/tracks/ruby/exercises/flatten-array/README.md +1 -1
  113. data/tracks/scala/exercises/gigasecond/example.scala +3 -3
  114. data/tracks/scala/exercises/gigasecond/src/main/scala/Gigasecond.scala +2 -2
  115. data/tracks/scala/exercises/gigasecond/src/test/scala/GigasecondTest.scala +12 -21
  116. data/tracks/scala/exercises/house/example.scala +6 -3
  117. data/tracks/scala/exercises/house/src/test/scala/HouseTest.scala +289 -97
  118. data/tracks/scala/exercises/isogram/src/main/scala/{Isogram.scala → .keep} +0 -0
  119. data/tracks/scala/exercises/isogram/src/test/scala/IsogramTest.scala +16 -19
  120. data/tracks/scala/testgen/src/main/scala/GigasecondTestGenerator.scala +49 -0
  121. data/tracks/scala/testgen/src/main/scala/HouseTestGenerator.scala +47 -0
  122. data/tracks/scala/testgen/src/main/scala/IsogramTestGenerator.scala +10 -31
  123. data/tracks/scala/testgen/src/main/scala/testgen/TestSuiteBuilder.scala +3 -3
  124. data/tracks/scala/testgen/src/main/twirl/funSuiteTemplate.scala.txt +5 -1
  125. data/tracks/swift/config.json +11 -0
  126. data/tracks/swift/exercises/rotational-cipher/.gitignore +4 -0
  127. data/tracks/swift/exercises/rotational-cipher/Package.swift +5 -0
  128. data/tracks/swift/exercises/rotational-cipher/Sources/RotationalCipher.swift +1 -0
  129. data/tracks/swift/exercises/rotational-cipher/Sources/RotationalCipherExample.swift +30 -0
  130. data/tracks/swift/exercises/rotational-cipher/Tests/LinuxMain.swift +6 -0
  131. data/tracks/swift/exercises/rotational-cipher/Tests/RotationalCipherTests/RotationalCipherTests.swift +70 -0
  132. metadata +51 -17
  133. data/tracks/csharp/generators/Output/BooleanTestMethodGenerator.cs +0 -13
  134. data/tracks/csharp/generators/Output/EqualityTestMethodGenerator.cs +0 -27
  135. data/tracks/csharp/generators/Output/ExceptionTestMethodGenerator.cs +0 -15
  136. data/tracks/csharp/generators/Output/TestClassGenerator.cs +0 -30
  137. data/tracks/csharp/generators/Output/TestClassRenderer.cs +0 -26
  138. data/tracks/csharp/generators/Output/TestMethodGenerator.cs +0 -94
  139. data/tracks/java/docs/img/eclipse-help-dropdown.png +0 -0
  140. data/tracks/java/docs/img/eclipse-mp-search-buildship-gradle.png +0 -0
  141. data/tracks/java/docs/img/mac-osx--idea-ce-run-unit-tests.png +0 -0
  142. data/tracks/java/docs/img/mac-osx--install-java-dialog.png +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 470dad2a5f3c954b1edd9a90c6647b0d49de1fe9
4
- data.tar.gz: 64691a2098334551e818a7475e54a091e5323199
3
+ metadata.gz: a1cf9097a8b18d5488bf067290e769160b8fc19a
4
+ data.tar.gz: 13c74e032073bdd9630e38743725eaef969ec419
5
5
  SHA512:
6
- metadata.gz: f5aec9958c8003f45c576a9cfb54290c4ec30118869f413ea756f8640e9bcf0f6895b0134f150b940ba8a51ab47291c85a509c5ddeaaa67fb250cae4d6f8b1e6
7
- data.tar.gz: 2e9d7f0176e6b8264008d2210bab27a1cfb723aaf546bd2fc90863bd3cc7f96b4e28522589a3b43ee4005eabb831c8836bf7a3259356843230b39205bc668ce6
6
+ metadata.gz: bea131b3c814916d7eef71efe54056fb5f8bb6a3d867bbd2e9be0246e2efa44169173867dc27400a2c397d475963a6774e983cfd7db1302dd2456776d22d32f9
7
+ data.tar.gz: 0bbd95c1fb47c0d80820f4df59276dc53acf374e26bed9dc457d287ae4d0a25bf6f285150c73c503bc763d3e032918b52a0ca029d73b77817faa426232c4c44d
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.2.1.12"
2
+ VERSION = "2.2.1.13"
3
3
  end
@@ -10,7 +10,8 @@ Given an age in seconds, calculate how old someone would be on:
10
10
  - Neptune: orbital period 164.79132 Earth years
11
11
 
12
12
  So if you were told someone were 1,000,000,000 seconds old, you should
13
- be able to say that they're 31 Earth-years old.
13
+ be able to say that they're 31.69 Earth-years old. Round all ages to
14
+ the nearest hundredth of a year.
14
15
 
15
16
  If you're wondering why Pluto didn't make the cut, go watch [this
16
17
  youtube video](http://www.youtube.com/watch?v=Z_2gbGXzFbs).
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "exercise": "two-fer",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "cases": [
5
5
  {
6
6
  "description": "no name given",
7
- "property": "twoFer",
7
+ "property": "name",
8
8
  "input": null,
9
9
  "expected": "One for you, one for me."
10
10
  },
11
11
  {
12
12
  "description": "a name given",
13
- "property": "twoFer",
13
+ "property": "name",
14
14
  "input": "Alice",
15
15
  "expected": "One for Alice, one for me."
16
16
  },
17
17
  {
18
18
  "description": "another name given",
19
- "property": "twoFer",
19
+ "property": "name",
20
20
  "input": "Bob",
21
21
  "expected": "One for Bob, one for me."
22
22
  }
@@ -16,4 +16,5 @@ bin/
16
16
  .dotnet/
17
17
  .fake/
18
18
  .paket/
19
- paket-files/
19
+ paket-files/
20
+ /generators/.problem-specifications/
@@ -42,10 +42,10 @@
42
42
  },
43
43
  {
44
44
  "github_username": "robkeim",
45
- "show_on_website": false,
45
+ "show_on_website": true,
46
46
  "alumnus": false,
47
- "name": null,
48
- "bio": null,
47
+ "name": "Rob Keim",
48
+ "bio": "I stumbled upon this site when I was trying to learn about functional programming and F#. Little did I know, I'd wind up becoming a contributor and learning a whole lot more than what I originally intended to. I had never contributed to an open source project before, and it's been a very rewarding experience.",
49
49
  "link_text": null,
50
50
  "link_url": null,
51
51
  "avatar_url": null
@@ -2,7 +2,7 @@
2
2
 
3
3
  public static class CollatzConjecture
4
4
  {
5
- public static int GetSteps(int input)
5
+ public static int Steps(int number)
6
6
  {
7
7
  throw new NotImplementedException("You need to implement this function");
8
8
  }
@@ -1,43 +1,43 @@
1
- // This file was auto-generated based on version 1.0.0 of the canonical data.
1
+ // This file was auto-generated based on version 1.1.1 of the canonical data.
2
2
 
3
- using System;
4
3
  using Xunit;
4
+ using System;
5
5
 
6
6
  public class CollatzConjectureTest
7
7
  {
8
8
  [Fact]
9
9
  public void Zero_steps_for_one()
10
10
  {
11
- Assert.Equal(0, CollatzConjecture.GetSteps(1));
11
+ Assert.Equal(0, CollatzConjecture.Steps(1));
12
12
  }
13
13
 
14
14
  [Fact(Skip = "Remove to run test")]
15
15
  public void Divide_if_even()
16
16
  {
17
- Assert.Equal(4, CollatzConjecture.GetSteps(16));
17
+ Assert.Equal(4, CollatzConjecture.Steps(16));
18
18
  }
19
19
 
20
20
  [Fact(Skip = "Remove to run test")]
21
21
  public void Even_and_odd_steps()
22
22
  {
23
- Assert.Equal(9, CollatzConjecture.GetSteps(12));
23
+ Assert.Equal(9, CollatzConjecture.Steps(12));
24
24
  }
25
25
 
26
26
  [Fact(Skip = "Remove to run test")]
27
27
  public void Large_number_of_even_and_odd_steps()
28
28
  {
29
- Assert.Equal(152, CollatzConjecture.GetSteps(1000000));
29
+ Assert.Equal(152, CollatzConjecture.Steps(1000000));
30
30
  }
31
31
 
32
32
  [Fact(Skip = "Remove to run test")]
33
33
  public void Zero_is_an_error()
34
34
  {
35
- Assert.Throws<ArgumentException>(() => CollatzConjecture.GetSteps(0));
35
+ Assert.Throws<ArgumentException>(() => CollatzConjecture.Steps(0));
36
36
  }
37
37
 
38
38
  [Fact(Skip = "Remove to run test")]
39
39
  public void Negative_value_is_an_error()
40
40
  {
41
- Assert.Throws<ArgumentException>(() => CollatzConjecture.GetSteps(-15));
41
+ Assert.Throws<ArgumentException>(() => CollatzConjecture.Steps(-15));
42
42
  }
43
43
  }
@@ -2,24 +2,24 @@
2
2
 
3
3
  public static class CollatzConjecture
4
4
  {
5
- public static int GetSteps(int input)
5
+ public static int Steps(int number)
6
6
  {
7
- if(input <= 0)
7
+ if(number <= 0)
8
8
  {
9
9
  throw new ArgumentException("Only positive numbers are allowed");
10
10
  }
11
11
 
12
12
  int stepCount = 0;
13
13
 
14
- while(input != 1)
14
+ while(number != 1)
15
15
  {
16
- if(input % 2 == 0)
16
+ if(number % 2 == 0)
17
17
  {
18
- input /= 2;
18
+ number /= 2;
19
19
  }
20
20
  else
21
21
  {
22
- input = (input * 3) + 1;
22
+ number = (number * 3) + 1;
23
23
  }
24
24
 
25
25
  stepCount++;
@@ -2,7 +2,7 @@
2
2
 
3
3
  public static class Gigasecond
4
4
  {
5
- public static DateTime Date(DateTime birthDate)
5
+ public static DateTime Add(DateTime birthDate)
6
6
  {
7
7
  return birthDate.AddSeconds(1000000000);
8
8
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  public static class Gigasecond
4
4
  {
5
- public static DateTime Date(DateTime birthDate)
5
+ public static DateTime Add(DateTime birthDate)
6
6
  {
7
7
  throw new NotImplementedException("You need to implement this function.");
8
8
  }
@@ -1,26 +1,37 @@
1
- using System;
1
+ // This file was auto-generated based on version 1.0.0 of the canonical data.
2
+
2
3
  using Xunit;
4
+ using System;
3
5
 
4
6
  public class GigasecondTest
5
7
  {
6
8
  [Fact]
7
- public void First_date()
9
+ public void Date_only_specification_of_time()
10
+ {
11
+ Assert.Equal(new DateTime(2043, 1, 1, 1, 46, 40), Gigasecond.Add(new DateTime(2011, 4, 25)));
12
+ }
13
+
14
+ [Fact(Skip = "Remove to run test")]
15
+ public void Second_test_for_date_only_specification_of_time()
16
+ {
17
+ Assert.Equal(new DateTime(2009, 2, 19, 1, 46, 40), Gigasecond.Add(new DateTime(1977, 6, 13)));
18
+ }
19
+
20
+ [Fact(Skip = "Remove to run test")]
21
+ public void Third_test_for_date_only_specification_of_time()
8
22
  {
9
- var date = Gigasecond.Date(new DateTime(2011, 4, 25, 0, 0, 0, DateTimeKind.Utc));
10
- Assert.Equal(new DateTime(2043, 1, 1, 1, 46, 40, DateTimeKind.Utc), date);
23
+ Assert.Equal(new DateTime(1991, 3, 27, 1, 46, 40), Gigasecond.Add(new DateTime(1959, 7, 19)));
11
24
  }
12
25
 
13
26
  [Fact(Skip = "Remove to run test")]
14
- public void Another_date()
27
+ public void Full_time_specified()
15
28
  {
16
- var date = Gigasecond.Date(new DateTime(1977, 6, 13, 0, 0, 0, DateTimeKind.Utc));
17
- Assert.Equal(new DateTime(2009, 2, 19, 1, 46, 40, DateTimeKind.Utc), date);
29
+ Assert.Equal(new DateTime(2046, 10, 2, 23, 46, 40), Gigasecond.Add(new DateTime(2015, 1, 24, 22, 0, 0)));
18
30
  }
19
31
 
20
32
  [Fact(Skip = "Remove to run test")]
21
- public void Yet_another_date()
33
+ public void Full_time_with_day_roll_over()
22
34
  {
23
- var date = Gigasecond.Date(new DateTime(1959, 7, 19, 0, 0, 0, DateTimeKind.Utc));
24
- Assert.Equal(new DateTime(1991, 3, 27, 1, 46, 40, DateTimeKind.Utc), date);
35
+ Assert.Equal(new DateTime(2046, 10, 3, 1, 46, 39), Gigasecond.Add(new DateTime(2015, 1, 24, 23, 59, 59)));
25
36
  }
26
37
  }
@@ -3,8 +3,13 @@
3
3
 
4
4
  public static class Hamming
5
5
  {
6
- public static int Compute(string firstStrand, string secondStrand)
6
+ public static int Distance(string firstStrand, string secondStrand)
7
7
  {
8
+ if (firstStrand.Length != secondStrand.Length)
9
+ {
10
+ throw new ArgumentException("strand lengths must be equal");
11
+ }
12
+
8
13
  return firstStrand.Where((x, i) => x != secondStrand[i]).Count();
9
14
  }
10
15
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  public static class Hamming
4
4
  {
5
- public static int Compute(string firstStrand, string secondStrand)
5
+ public static int Distance(string firstStrand, string secondStrand)
6
6
  {
7
7
  throw new NotImplementedException("You need to implement this function.");
8
8
  }
@@ -1,40 +1,97 @@
1
+ // This file was auto-generated based on version 2.0.0 of the canonical data.
2
+
1
3
  using Xunit;
4
+ using System;
2
5
 
3
6
  public class HammingTest
4
7
  {
5
8
  [Fact]
6
- public void No_difference_between_empty_strands()
9
+ public void Empty_strands()
10
+ {
11
+ Assert.Equal(0, Hamming.Distance("", ""));
12
+ }
13
+
14
+ [Fact(Skip = "Remove to run test")]
15
+ public void Identical_strands()
16
+ {
17
+ Assert.Equal(0, Hamming.Distance("A", "A"));
18
+ }
19
+
20
+ [Fact(Skip = "Remove to run test")]
21
+ public void Long_identical_strands()
22
+ {
23
+ Assert.Equal(0, Hamming.Distance("GGACTGA", "GGACTGA"));
24
+ }
25
+
26
+ [Fact(Skip = "Remove to run test")]
27
+ public void Complete_distance_in_single_nucleotide_strands()
28
+ {
29
+ Assert.Equal(1, Hamming.Distance("A", "G"));
30
+ }
31
+
32
+ [Fact(Skip = "Remove to run test")]
33
+ public void Complete_distance_in_small_strands()
34
+ {
35
+ Assert.Equal(2, Hamming.Distance("AG", "CT"));
36
+ }
37
+
38
+ [Fact(Skip = "Remove to run test")]
39
+ public void Small_distance_in_small_strands()
40
+ {
41
+ Assert.Equal(1, Hamming.Distance("AT", "CT"));
42
+ }
43
+
44
+ [Fact(Skip = "Remove to run test")]
45
+ public void Small_distance()
46
+ {
47
+ Assert.Equal(1, Hamming.Distance("GGACG", "GGTCG"));
48
+ }
49
+
50
+ [Fact(Skip = "Remove to run test")]
51
+ public void Small_distance_in_long_strands()
52
+ {
53
+ Assert.Equal(2, Hamming.Distance("ACCAGGG", "ACTATGG"));
54
+ }
55
+
56
+ [Fact(Skip = "Remove to run test")]
57
+ public void Non_unique_character_in_first_strand()
58
+ {
59
+ Assert.Equal(1, Hamming.Distance("AGA", "AGG"));
60
+ }
61
+
62
+ [Fact(Skip = "Remove to run test")]
63
+ public void Non_unique_character_in_second_strand()
7
64
  {
8
- Assert.Equal(0, Hamming.Compute("",""));
65
+ Assert.Equal(1, Hamming.Distance("AGG", "AGA"));
9
66
  }
10
67
 
11
68
  [Fact(Skip = "Remove to run test")]
12
- public void No_difference_between_identical_strands()
69
+ public void Same_nucleotides_in_different_positions()
13
70
  {
14
- Assert.Equal(0, Hamming.Compute("GGACTGA","GGACTGA"));
71
+ Assert.Equal(2, Hamming.Distance("TAG", "GAT"));
15
72
  }
16
73
 
17
74
  [Fact(Skip = "Remove to run test")]
18
- public void Complete_hamming_distance_in_small_strand()
75
+ public void Large_distance()
19
76
  {
20
- Assert.Equal(3, Hamming.Compute("ACT","GGA"));
77
+ Assert.Equal(4, Hamming.Distance("GATACA", "GCATAA"));
21
78
  }
22
79
 
23
80
  [Fact(Skip = "Remove to run test")]
24
- public void Hamming_distance_is_off_by_one_strand()
81
+ public void Large_distance_in_off_by_one_strand()
25
82
  {
26
- Assert.Equal(9, Hamming.Compute("GGACGGATTCTG","AGGACGGATTCT"));
83
+ Assert.Equal(9, Hamming.Distance("GGACGGATTCTG", "AGGACGGATTCT"));
27
84
  }
28
85
 
29
86
  [Fact(Skip = "Remove to run test")]
30
- public void Smalling_hamming_distance_in_middle_somewhere()
87
+ public void Disallow_first_strand_longer()
31
88
  {
32
- Assert.Equal(1, Hamming.Compute("GGACG","GGTCG"));
89
+ Assert.Throws<ArgumentException>(() => Hamming.Distance("AATG", "AAA"));
33
90
  }
34
91
 
35
92
  [Fact(Skip = "Remove to run test")]
36
- public void Larger_distance()
93
+ public void Disallow_second_strand_longer()
37
94
  {
38
- Assert.Equal(2, Hamming.Compute("ACCAGGG","ACTATGG"));
95
+ Assert.Throws<ArgumentException>(() => Hamming.Distance("ATA", "AGTG"));
39
96
  }
40
97
  }
@@ -1,74 +1,69 @@
1
- using Xunit;
1
+ // This file was auto-generated based on version 1.1.0 of the canonical data.
2
+
3
+ using Xunit;
2
4
 
3
5
  public class PangramTest
4
6
  {
5
7
  [Fact]
6
- public void Empty_sentence()
8
+ public void Sentence_empty()
7
9
  {
8
10
  var input = "";
9
- Assert.Equal(false, Pangram.IsPangram(input));
11
+ Assert.False(Pangram.IsPangram(input));
10
12
  }
11
13
 
12
14
  [Fact(Skip = "Remove to run test")]
13
15
  public void Pangram_with_only_lower_case()
14
16
  {
15
17
  var input = "the quick brown fox jumps over the lazy dog";
16
- Assert.Equal(true, Pangram.IsPangram(input));
18
+ Assert.True(Pangram.IsPangram(input));
17
19
  }
18
20
 
19
21
  [Fact(Skip = "Remove to run test")]
20
22
  public void Missing_character_x()
21
23
  {
22
24
  var input = "a quick movement of the enemy will jeopardize five gunboats";
23
- Assert.Equal(false, Pangram.IsPangram(input));
25
+ Assert.False(Pangram.IsPangram(input));
24
26
  }
25
27
 
26
28
  [Fact(Skip = "Remove to run test")]
27
29
  public void Another_missing_character_x()
28
30
  {
29
31
  var input = "the quick brown fish jumps over the lazy dog";
30
- Assert.Equal(false, Pangram.IsPangram(input));
32
+ Assert.False(Pangram.IsPangram(input));
31
33
  }
32
34
 
33
35
  [Fact(Skip = "Remove to run test")]
34
36
  public void Pangram_with_underscores()
35
37
  {
36
38
  var input = "the_quick_brown_fox_jumps_over_the_lazy_dog";
37
- Assert.Equal(true, Pangram.IsPangram(input));
39
+ Assert.True(Pangram.IsPangram(input));
38
40
  }
39
41
 
40
42
  [Fact(Skip = "Remove to run test")]
41
43
  public void Pangram_with_numbers()
42
44
  {
43
45
  var input = "the 1 quick brown fox jumps over the 2 lazy dogs";
44
- Assert.Equal(true, Pangram.IsPangram(input));
46
+ Assert.True(Pangram.IsPangram(input));
45
47
  }
46
48
 
47
49
  [Fact(Skip = "Remove to run test")]
48
50
  public void Missing_letters_replaced_by_numbers()
49
51
  {
50
52
  var input = "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog";
51
- Assert.Equal(false, Pangram.IsPangram(input));
53
+ Assert.False(Pangram.IsPangram(input));
52
54
  }
53
55
 
54
56
  [Fact(Skip = "Remove to run test")]
55
57
  public void Pangram_with_mixed_case_and_punctuation()
56
58
  {
57
59
  var input = "\"Five quacking Zephyrs jolt my wax bed.\"";
58
- Assert.Equal(true, Pangram.IsPangram(input));
59
- }
60
-
61
- [Fact(Skip = "Remove to run test")]
62
- public void Pangram_with_non_ascii_characters()
63
- {
64
- var input = "Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich.";
65
- Assert.Equal(true, Pangram.IsPangram(input));
60
+ Assert.True(Pangram.IsPangram(input));
66
61
  }
67
62
 
68
63
  [Fact(Skip = "Remove to run test")]
69
- public void Pangram_in_alphabet_other_than_ascii()
64
+ public void Upper_and_lower_case_versions_of_the_same_character_should_not_be_counted_separately()
70
65
  {
71
- var input = "Широкая электрификация южных губерний даст мощный толчок подъёму сельского хозяйства.";
72
- Assert.Equal(false, Pangram.IsPangram(input));
66
+ var input = "the quick brown fox jumps over with lazy FX";
67
+ Assert.False(Pangram.IsPangram(input));
73
68
  }
74
69
  }