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.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/space-age/description.md +2 -1
- data/problem-specifications/exercises/two-fer/canonical-data.json +4 -4
- data/tracks/csharp/.gitignore +2 -1
- data/tracks/csharp/config/maintainers.json +3 -3
- data/tracks/csharp/exercises/collatz-conjecture/CollatzConjecture.cs +1 -1
- data/tracks/csharp/exercises/collatz-conjecture/CollatzConjectureTest.cs +8 -8
- data/tracks/csharp/exercises/collatz-conjecture/Example.cs +6 -6
- data/tracks/csharp/exercises/gigasecond/Example.cs +1 -1
- data/tracks/csharp/exercises/gigasecond/Gigasecond.cs +1 -1
- data/tracks/csharp/exercises/gigasecond/GigasecondTest.cs +21 -10
- data/tracks/csharp/exercises/hamming/Example.cs +6 -1
- data/tracks/csharp/exercises/hamming/Hamming.cs +1 -1
- data/tracks/csharp/exercises/hamming/HammingTest.cs +69 -12
- data/tracks/csharp/exercises/pangram/PangramTest.cs +15 -20
- data/tracks/csharp/exercises/phone-number/Example.cs +15 -42
- data/tracks/csharp/exercises/phone-number/PhoneNumber.cs +2 -17
- data/tracks/csharp/exercises/phone-number/PhoneNumberTest.cs +57 -20
- data/tracks/csharp/exercises/prime-factors/Example.cs +1 -1
- data/tracks/csharp/exercises/prime-factors/PrimeFactors.cs +1 -1
- data/tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs +16 -38
- data/tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs +21 -19
- data/tracks/csharp/exercises/rna-transcription/Example.cs +7 -2
- data/tracks/csharp/exercises/rna-transcription/RnaTranscription.cs +2 -2
- data/tracks/csharp/exercises/rna-transcription/RnaTranscriptionTest.cs +26 -6
- data/tracks/csharp/exercises/rotational-cipher/RotationalCipherTest.cs +7 -7
- data/tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs +53 -29
- data/tracks/csharp/exercises/scrabble-score/Example.cs +2 -2
- data/tracks/csharp/exercises/scrabble-score/ScrabbleScore.cs +1 -1
- data/tracks/csharp/exercises/scrabble-score/ScrabbleScoreTest.cs +33 -19
- data/tracks/csharp/exercises/secret-handshake/SecretHandshake.cs +0 -1
- data/tracks/csharp/exercises/secret-handshake/SecretHandshakeTest.cs +36 -10
- data/tracks/csharp/exercises/two-fer/Example.cs +1 -1
- data/tracks/csharp/exercises/two-fer/TwoFer.cs +1 -1
- data/tracks/csharp/exercises/two-fer/TwoFerTest.cs +19 -19
- data/tracks/csharp/generators/.gitignore +1 -1
- data/tracks/csharp/generators/Exercise.cs +85 -10
- data/tracks/csharp/generators/Exercises/AllYourBase.cs +3 -14
- data/tracks/csharp/generators/Exercises/Allergies.cs +21 -18
- data/tracks/csharp/generators/Exercises/Alphametics.cs +6 -7
- data/tracks/csharp/generators/Exercises/Anagram.cs +4 -4
- data/tracks/csharp/generators/Exercises/BeerSong.cs +4 -2
- data/tracks/csharp/generators/Exercises/BinarySearch.cs +3 -3
- data/tracks/csharp/generators/Exercises/BookStore.cs +3 -3
- data/tracks/csharp/generators/Exercises/BracketPush.cs +4 -2
- data/tracks/csharp/generators/Exercises/CollatzConjecture.cs +16 -0
- data/tracks/csharp/generators/Exercises/ConvertExtensions.cs +12 -0
- data/tracks/csharp/generators/Exercises/CryptoSquare.cs +3 -2
- data/tracks/csharp/generators/Exercises/FoodChain.cs +3 -3
- data/tracks/csharp/generators/Exercises/Gigasecond.cs +38 -0
- data/tracks/csharp/generators/Exercises/Hamming.cs +16 -0
- data/tracks/csharp/generators/Exercises/Leap.cs +4 -2
- data/tracks/csharp/generators/Exercises/Luhn.cs +3 -1
- data/tracks/csharp/generators/Exercises/NthPrime.cs +2 -10
- data/tracks/csharp/generators/Exercises/Pangram.cs +17 -0
- data/tracks/csharp/generators/Exercises/PerfectNumbers.cs +2 -9
- data/tracks/csharp/generators/Exercises/PhoneNumber.cs +15 -0
- data/tracks/csharp/generators/Exercises/PrimeFactors.cs +6 -0
- data/tracks/csharp/generators/Exercises/RailFenceCipher.cs +23 -0
- data/tracks/csharp/generators/Exercises/RnaTranscription.cs +6 -0
- data/tracks/csharp/generators/Exercises/RomanNumerals.cs +4 -2
- data/tracks/csharp/generators/Exercises/RunLengthEncoding.cs +40 -0
- data/tracks/csharp/generators/Exercises/ScrabbleScore.cs +6 -0
- data/tracks/csharp/generators/Exercises/SecretHandshake.cs +15 -0
- data/tracks/csharp/generators/Exercises/Transpose.cs +4 -4
- data/tracks/csharp/generators/Exercises/TwoFer.cs +6 -0
- data/tracks/csharp/generators/Exercises/Wordy.cs +2 -10
- data/tracks/csharp/generators/Generators.csproj +1 -3
- data/tracks/csharp/generators/Input/CanonicalDataFile.cs +48 -11
- data/tracks/csharp/generators/Input/CanonicalDataOptions.cs +8 -0
- data/tracks/csharp/generators/Input/CanonicalDataParser.cs +11 -3
- data/tracks/csharp/generators/Options.cs +8 -0
- data/tracks/csharp/generators/Output/{TestClassFile.cs → ExerciseWriter.cs} +4 -3
- data/tracks/csharp/generators/Output/FormattingExtensions.cs +14 -0
- data/tracks/csharp/generators/Output/IndentFilter.cs +13 -0
- data/tracks/csharp/generators/Output/TemplateRenderer.cs +23 -0
- data/tracks/csharp/generators/Output/Templates/_Act.liquid +1 -0
- data/tracks/csharp/generators/Output/Templates/_Arrange.liquid +3 -0
- data/tracks/csharp/generators/Output/Templates/_AssertBoolean.liquid +1 -0
- data/tracks/csharp/generators/Output/Templates/_AssertEqual.liquid +1 -0
- data/tracks/csharp/generators/Output/Templates/_AssertEqual_Empty.liquid +1 -0
- data/tracks/csharp/generators/Output/Templates/_AssertNull.liquid +1 -0
- data/tracks/csharp/generators/Output/Templates/_AssertThrowsException.liquid +1 -0
- data/tracks/csharp/generators/Output/{TestClass.liquid → Templates/_TestClass.liquid} +2 -8
- data/tracks/csharp/generators/Output/Templates/_TestMethod.liquid +5 -0
- data/tracks/csharp/generators/Output/Templates/_TestMethodBody.liquid +3 -0
- data/tracks/csharp/generators/Output/TestClass.cs +5 -2
- data/tracks/csharp/generators/Output/TestMethod.cs +6 -6
- data/tracks/csharp/generators/Output/TestMethodBody.cs +49 -0
- data/tracks/csharp/generators/Output/TestMethodBodyData.cs +85 -0
- data/tracks/csharp/generators/Output/TestMethodBodyWithBooleanCheck.cs +16 -0
- data/tracks/csharp/generators/Output/TestMethodBodyWithEqualityCheck.cs +21 -0
- data/tracks/csharp/generators/Output/TestMethodBodyWithExceptionCheck.cs +18 -0
- data/tracks/csharp/generators/Output/TestMethodBodyWithNullCheck.cs +13 -0
- data/tracks/csharp/generators/Output/UnescapedValue.cs +6 -2
- data/tracks/csharp/generators/Output/ValueFormatter.cs +1 -10
- data/tracks/csharp/generators/Program.cs +34 -8
- data/tracks/delphi/config/maintainers.json +1 -1
- data/tracks/delphi/docs/{Getting_Started_Guide.md → GETTING_STARTED_GUIDE.md} +0 -0
- data/tracks/fsharp/config.json +16 -5
- data/tracks/fsharp/config/maintainers.json +3 -3
- data/tracks/fsharp/exercises/two-fer/Example.fs +4 -0
- data/tracks/fsharp/exercises/two-fer/README.md +28 -0
- data/tracks/fsharp/exercises/two-fer/TwoFerTest.fs +19 -0
- data/tracks/groovy/CONTRIBUTING.md +19 -0
- data/tracks/groovy/README.md +10 -2
- data/tracks/java/exercises/allergies/src/example/java/Allergies.java +1 -1
- data/tracks/r/bin/run_tests.R +1 -4
- data/tracks/r/docs/{snippet.txt → SNIPPET.txt} +0 -0
- data/tracks/r/exercises/hamming/example.R +1 -1
- data/tracks/ruby/exercises/flatten-array/README.md +1 -1
- data/tracks/scala/exercises/gigasecond/example.scala +3 -3
- data/tracks/scala/exercises/gigasecond/src/main/scala/Gigasecond.scala +2 -2
- data/tracks/scala/exercises/gigasecond/src/test/scala/GigasecondTest.scala +12 -21
- data/tracks/scala/exercises/house/example.scala +6 -3
- data/tracks/scala/exercises/house/src/test/scala/HouseTest.scala +289 -97
- data/tracks/scala/exercises/isogram/src/main/scala/{Isogram.scala → .keep} +0 -0
- data/tracks/scala/exercises/isogram/src/test/scala/IsogramTest.scala +16 -19
- data/tracks/scala/testgen/src/main/scala/GigasecondTestGenerator.scala +49 -0
- data/tracks/scala/testgen/src/main/scala/HouseTestGenerator.scala +47 -0
- data/tracks/scala/testgen/src/main/scala/IsogramTestGenerator.scala +10 -31
- data/tracks/scala/testgen/src/main/scala/testgen/TestSuiteBuilder.scala +3 -3
- data/tracks/scala/testgen/src/main/twirl/funSuiteTemplate.scala.txt +5 -1
- data/tracks/swift/config.json +11 -0
- data/tracks/swift/exercises/rotational-cipher/.gitignore +4 -0
- data/tracks/swift/exercises/rotational-cipher/Package.swift +5 -0
- data/tracks/swift/exercises/rotational-cipher/Sources/RotationalCipher.swift +1 -0
- data/tracks/swift/exercises/rotational-cipher/Sources/RotationalCipherExample.swift +30 -0
- data/tracks/swift/exercises/rotational-cipher/Tests/LinuxMain.swift +6 -0
- data/tracks/swift/exercises/rotational-cipher/Tests/RotationalCipherTests/RotationalCipherTests.swift +70 -0
- metadata +51 -17
- data/tracks/csharp/generators/Output/BooleanTestMethodGenerator.cs +0 -13
- data/tracks/csharp/generators/Output/EqualityTestMethodGenerator.cs +0 -27
- data/tracks/csharp/generators/Output/ExceptionTestMethodGenerator.cs +0 -15
- data/tracks/csharp/generators/Output/TestClassGenerator.cs +0 -30
- data/tracks/csharp/generators/Output/TestClassRenderer.cs +0 -26
- data/tracks/csharp/generators/Output/TestMethodGenerator.cs +0 -94
- data/tracks/java/docs/img/eclipse-help-dropdown.png +0 -0
- data/tracks/java/docs/img/eclipse-mp-search-buildship-gradle.png +0 -0
- data/tracks/java/docs/img/mac-osx--idea-ce-run-unit-tests.png +0 -0
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1cf9097a8b18d5488bf067290e769160b8fc19a
|
4
|
+
data.tar.gz: 13c74e032073bdd9630e38743725eaef969ec419
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bea131b3c814916d7eef71efe54056fb5f8bb6a3d867bbd2e9be0246e2efa44169173867dc27400a2c397d475963a6774e983cfd7db1302dd2456776d22d32f9
|
7
|
+
data.tar.gz: 0bbd95c1fb47c0d80820f4df59276dc53acf374e26bed9dc457d287ae4d0a25bf6f285150c73c503bc763d3e032918b52a0ca029d73b77817faa426232c4c44d
|
data/lib/trackler/version.rb
CHANGED
@@ -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.
|
3
|
+
"version": "1.1.0",
|
4
4
|
"cases": [
|
5
5
|
{
|
6
6
|
"description": "no name given",
|
7
|
-
"property": "
|
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": "
|
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": "
|
19
|
+
"property": "name",
|
20
20
|
"input": "Bob",
|
21
21
|
"expected": "One for Bob, one for me."
|
22
22
|
}
|
data/tracks/csharp/.gitignore
CHANGED
@@ -42,10 +42,10 @@
|
|
42
42
|
},
|
43
43
|
{
|
44
44
|
"github_username": "robkeim",
|
45
|
-
"show_on_website":
|
45
|
+
"show_on_website": true,
|
46
46
|
"alumnus": false,
|
47
|
-
"name":
|
48
|
-
"bio":
|
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
|
@@ -1,43 +1,43 @@
|
|
1
|
-
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
5
|
+
public static int Steps(int number)
|
6
6
|
{
|
7
|
-
if(
|
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(
|
14
|
+
while(number != 1)
|
15
15
|
{
|
16
|
-
if(
|
16
|
+
if(number % 2 == 0)
|
17
17
|
{
|
18
|
-
|
18
|
+
number /= 2;
|
19
19
|
}
|
20
20
|
else
|
21
21
|
{
|
22
|
-
|
22
|
+
number = (number * 3) + 1;
|
23
23
|
}
|
24
24
|
|
25
25
|
stepCount++;
|
@@ -1,26 +1,37 @@
|
|
1
|
-
|
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
|
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
|
-
|
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
|
27
|
+
public void Full_time_specified()
|
15
28
|
{
|
16
|
-
|
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
|
33
|
+
public void Full_time_with_day_roll_over()
|
22
34
|
{
|
23
|
-
|
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
|
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
|
}
|
@@ -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
|
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(
|
65
|
+
Assert.Equal(1, Hamming.Distance("AGG", "AGA"));
|
9
66
|
}
|
10
67
|
|
11
68
|
[Fact(Skip = "Remove to run test")]
|
12
|
-
public void
|
69
|
+
public void Same_nucleotides_in_different_positions()
|
13
70
|
{
|
14
|
-
Assert.Equal(
|
71
|
+
Assert.Equal(2, Hamming.Distance("TAG", "GAT"));
|
15
72
|
}
|
16
73
|
|
17
74
|
[Fact(Skip = "Remove to run test")]
|
18
|
-
public void
|
75
|
+
public void Large_distance()
|
19
76
|
{
|
20
|
-
Assert.Equal(
|
77
|
+
Assert.Equal(4, Hamming.Distance("GATACA", "GCATAA"));
|
21
78
|
}
|
22
79
|
|
23
80
|
[Fact(Skip = "Remove to run test")]
|
24
|
-
public void
|
81
|
+
public void Large_distance_in_off_by_one_strand()
|
25
82
|
{
|
26
|
-
Assert.Equal(9, Hamming.
|
83
|
+
Assert.Equal(9, Hamming.Distance("GGACGGATTCTG", "AGGACGGATTCT"));
|
27
84
|
}
|
28
85
|
|
29
86
|
[Fact(Skip = "Remove to run test")]
|
30
|
-
public void
|
87
|
+
public void Disallow_first_strand_longer()
|
31
88
|
{
|
32
|
-
Assert.
|
89
|
+
Assert.Throws<ArgumentException>(() => Hamming.Distance("AATG", "AAA"));
|
33
90
|
}
|
34
91
|
|
35
92
|
[Fact(Skip = "Remove to run test")]
|
36
|
-
public void
|
93
|
+
public void Disallow_second_strand_longer()
|
37
94
|
{
|
38
|
-
Assert.
|
95
|
+
Assert.Throws<ArgumentException>(() => Hamming.Distance("ATA", "AGTG"));
|
39
96
|
}
|
40
97
|
}
|
@@ -1,74 +1,69 @@
|
|
1
|
-
|
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
|
8
|
+
public void Sentence_empty()
|
7
9
|
{
|
8
10
|
var input = "";
|
9
|
-
Assert.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
64
|
+
public void Upper_and_lower_case_versions_of_the_same_character_should_not_be_counted_separately()
|
70
65
|
{
|
71
|
-
var input = "
|
72
|
-
Assert.
|
66
|
+
var input = "the quick brown fox jumps over with lazy FX";
|
67
|
+
Assert.False(Pangram.IsPangram(input));
|
73
68
|
}
|
74
69
|
}
|