Skip to content

Update canonical data to latest version #1292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions exercises/anagram/AnagramTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was auto-generated based on version 1.4.0 of the canonical data.
// This file was auto-generated based on version 1.4.1 of the canonical data.

using Xunit;

Expand Down Expand Up @@ -83,7 +83,7 @@ public void Detects_anagrams_using_case_insensitive_possible_matches()
}

[Fact(Skip = "Remove to run test")]
public void Does_not_detect_a_anagram_if_the_original_word_is_repeated()
public void Does_not_detect_an_anagram_if_the_original_word_is_repeated()
{
var candidates = new[] { "go Go GO" };
var sut = new Anagram("go");
Expand Down
8 changes: 7 additions & 1 deletion exercises/armstrong-numbers/ArmstrongNumbersTest.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
// This file was auto-generated based on version 1.0.0 of the canonical data.
// This file was auto-generated based on version 1.1.0 of the canonical data.

using Xunit;

public class ArmstrongNumbersTest
{
[Fact]
public void Zero_is_an_armstrong_number()
{
Assert.True(ArmstrongNumbers.IsArmstrongNumber(0));
}

[Fact(Skip = "Remove to run test")]
public void Single_digit_numbers_are_armstrong_numbers()
{
Assert.True(ArmstrongNumbers.IsArmstrongNumber(5));
Expand Down
60 changes: 48 additions & 12 deletions exercises/darts/DartsTest.cs
Original file line number Diff line number Diff line change
@@ -1,48 +1,84 @@
// This file was auto-generated based on version 1.1.0 of the canonical data.
// This file was auto-generated based on version 2.2.0 of the canonical data.

using Xunit;

public class DartsTest
{
[Fact]
public void A_dart_lands_outside_the_target()
public void Missed_target()
{
Assert.Equal(0, Darts.Score(-9, 9));
}

[Fact(Skip = "Remove to run test")]
public void A_dart_lands_just_in_the_border_of_the_target()
public void On_the_outer_circle()
{
Assert.Equal(1, Darts.Score(0, 10));
}

[Fact(Skip = "Remove to run test")]
public void A_dart_lands_in_the_outer_circle()
public void On_the_middle_circle()
{
Assert.Equal(1, Darts.Score(4, 4));
Assert.Equal(5, Darts.Score(-5, 0));
}

[Fact(Skip = "Remove to run test")]
public void A_dart_lands_right_in_the_border_between_outer_and_middle_circles()
public void On_the_inner_circle()
{
Assert.Equal(5, Darts.Score(5, 0));
Assert.Equal(10, Darts.Score(0, -1));
}

[Fact(Skip = "Remove to run test")]
public void Exactly_on_centre()
{
Assert.Equal(10, Darts.Score(0, 0));
}

[Fact(Skip = "Remove to run test")]
public void Near_the_centre()
{
Assert.Equal(10, Darts.Score(-0.1, -0.1));
}

[Fact(Skip = "Remove to run test")]
public void Just_within_the_inner_circle()
{
Assert.Equal(10, Darts.Score(0.7, 0.7));
}

[Fact(Skip = "Remove to run test")]
public void A_dart_lands_in_the_middle_circle()
public void Just_outside_the_inner_circle()
{
Assert.Equal(5, Darts.Score(0.8, -0.8));
}

[Fact(Skip = "Remove to run test")]
public void A_dart_lands_right_in_the_border_between_middle_and_inner_circles()
public void Just_within_the_middle_circle()
{
Assert.Equal(10, Darts.Score(0, -1));
Assert.Equal(5, Darts.Score(-3.5, 3.5));
}

[Fact(Skip = "Remove to run test")]
public void A_dart_lands_in_the_inner_circle()
public void Just_outside_the_middle_circle()
{
Assert.Equal(10, Darts.Score(-0.1, -0.1));
Assert.Equal(1, Darts.Score(-3.6, -3.6));
}

[Fact(Skip = "Remove to run test")]
public void Just_within_the_outer_circle()
{
Assert.Equal(1, Darts.Score(-7, 7));
}

[Fact(Skip = "Remove to run test")]
public void Just_outside_the_outer_circle()
{
Assert.Equal(0, Darts.Score(7.1, -7.1));
}

[Fact(Skip = "Remove to run test")]
public void Asymmetric_position_between_the_inner_and_middle_circles()
{
Assert.Equal(5, Darts.Score(0.5, -4));
}
}
8 changes: 4 additions & 4 deletions exercises/diffie-hellman/DiffieHellmanTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public void Key_exchange()
var g = new BigInteger(5);
var alicePrivateKey = DiffieHellman.PrivateKey(p);
var bobPrivateKey = DiffieHellman.PrivateKey(p);
var alicePublicKey = DiffieHellman.PublicKey(p, g, alicePrivateKey);
var bobPublicKey = DiffieHellman.PublicKey(p, g, bobPrivateKey);
var secretA = DiffieHellman.Secret(p, bobPublicKey, alicePrivateKey);
var secretB = DiffieHellman.Secret(p, alicePublicKey, bobPrivateKey);
var alicePublicKey = DiffieHellman.PublicKey(p,G,AlicePrivateKey);
var bobPublicKey = DiffieHellman.PublicKey(p,G,BobPrivateKey);
var secretA = DiffieHellman.Secret(p,BobPublicKey,AlicePrivateKey);
var secretB = DiffieHellman.Secret(p,AlicePublicKey,BobPrivateKey);
Assert.Equal(secretA, secretB);
}
}
2 changes: 1 addition & 1 deletion exercises/forth/ForthTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was auto-generated based on version 1.7.0 of the canonical data.
// This file was auto-generated based on version 1.7.1 of the canonical data.

using System;
using Xunit;
Expand Down
16 changes: 11 additions & 5 deletions exercises/luhn/LuhnTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was auto-generated based on version 1.4.0 of the canonical data.
// This file was auto-generated based on version 1.6.1 of the canonical data.

using Xunit;

Expand Down Expand Up @@ -53,9 +53,9 @@ public void Valid_number_with_an_even_number_of_digits()
}

[Fact(Skip = "Remove to run test")]
public void Valid_strings_with_a_non_digit_included_become_invalid()
public void Valid_number_with_an_odd_number_of_spaces()
{
Assert.False(Luhn.IsValid("055a 444 285"));
Assert.True(Luhn.IsValid("234 567 891 234"));
}

[Fact(Skip = "Remove to run test")]
Expand All @@ -73,7 +73,7 @@ public void Valid_strings_with_punctuation_included_become_invalid()
[Fact(Skip = "Remove to run test")]
public void Valid_strings_with_symbols_included_become_invalid()
{
Assert.False(Luhn.IsValid("055£ 444$ 285"));
Assert.False(Luhn.IsValid("055# 444$ 285"));
}

[Fact(Skip = "Remove to run test")]
Expand All @@ -95,7 +95,13 @@ public void Input_digit_9_is_correctly_converted_to_output_digit_9()
}

[Fact(Skip = "Remove to run test")]
public void Strings_with_non_digits_is_invalid()
public void Using_ascii_value_for_non_doubled_non_digit_isnt_allowed()
{
Assert.False(Luhn.IsValid("055b 444 285"));
}

[Fact(Skip = "Remove to run test")]
public void Using_ascii_value_for_doubled_non_digit_isnt_allowed()
{
Assert.False(Luhn.IsValid(":9"));
}
Expand Down
20 changes: 10 additions & 10 deletions exercises/pangram/PangramTest.cs
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
// This file was auto-generated based on version 1.4.1 of the canonical data.
// This file was auto-generated based on version 2.0.0 of the canonical data.

using Xunit;

public class PangramTest
{
[Fact]
public void Sentence_empty()
public void Empty_sentence()
{
Assert.False(Pangram.IsPangram(""));
}

[Fact(Skip = "Remove to run test")]
public void Recognizes_a_perfect_lower_case_pangram()
public void Perfect_lower_case()
{
Assert.True(Pangram.IsPangram("abcdefghijklmnopqrstuvwxyz"));
}

[Fact(Skip = "Remove to run test")]
public void Pangram_with_only_lower_case()
public void Only_lower_case()
{
Assert.True(Pangram.IsPangram("the quick brown fox jumps over the lazy dog"));
}

[Fact(Skip = "Remove to run test")]
public void Missing_character_x()
public void Missing_the_letter_x()
{
Assert.False(Pangram.IsPangram("a quick movement of the enemy will jeopardize five gunboats"));
}

[Fact(Skip = "Remove to run test")]
public void Another_missing_character_e_g_h()
public void Missing_the_letter_h()
{
Assert.False(Pangram.IsPangram("five boxing wizards jump quickly at it"));
}

[Fact(Skip = "Remove to run test")]
public void Pangram_with_underscores()
public void With_underscores()
{
Assert.True(Pangram.IsPangram("the_quick_brown_fox_jumps_over_the_lazy_dog"));
}

[Fact(Skip = "Remove to run test")]
public void Pangram_with_numbers()
public void With_numbers()
{
Assert.True(Pangram.IsPangram("the 1 quick brown fox jumps over the 2 lazy dogs"));
}
Expand All @@ -53,13 +53,13 @@ public void Missing_letters_replaced_by_numbers()
}

[Fact(Skip = "Remove to run test")]
public void Pangram_with_mixed_case_and_punctuation()
public void Mixed_case_and_punctuation()
{
Assert.True(Pangram.IsPangram("\"Five quacking Zephyrs jolt my wax bed.\""));
}

[Fact(Skip = "Remove to run test")]
public void Upper_and_lower_case_versions_of_the_same_character_should_not_be_counted_separately()
public void Case_insensitive()
{
Assert.False(Pangram.IsPangram("the quick brown fox jumps over with lazy FX"));
}
Expand Down
6 changes: 3 additions & 3 deletions exercises/queen-attack/QueenAttackTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was auto-generated based on version 2.2.0 of the canonical data.
// This file was auto-generated based on version 2.3.0 of the canonical data.

using System;
using Xunit;
Expand Down Expand Up @@ -86,8 +86,8 @@ public void Can_attack_on_third_diagonal()
[Fact(Skip = "Remove to run test")]
public void Can_attack_on_fourth_diagonal()
{
var whiteQueen = QueenAttack.Create(2,2);
var blackQueen = QueenAttack.Create(5,5);
var whiteQueen = QueenAttack.Create(1,7);
var blackQueen = QueenAttack.Create(0,6);
Assert.True(QueenAttack.CanAttack(whiteQueen, blackQueen));
}
}
14 changes: 13 additions & 1 deletion exercises/rational-numbers/RationalNumbersTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was auto-generated based on version 1.0.0 of the canonical data.
// This file was auto-generated based on version 1.1.0 of the canonical data.

using Xunit;

Expand Down Expand Up @@ -118,12 +118,24 @@ public void Absolute_value_of_a_positive_rational_number()
Assert.Equal(new RationalNumber(1, 2), new RationalNumber(1, 2).Abs());
}

[Fact(Skip = "Remove to run test")]
public void Absolute_value_of_a_positive_rational_number_with_negative_numerator_and_denominator()
{
Assert.Equal(new RationalNumber(1, 2), new RationalNumber(-1, -2).Abs());
}

[Fact(Skip = "Remove to run test")]
public void Absolute_value_of_a_negative_rational_number()
{
Assert.Equal(new RationalNumber(1, 2), new RationalNumber(-1, 2).Abs());
}

[Fact(Skip = "Remove to run test")]
public void Absolute_value_of_a_negative_rational_number_with_negative_denominator()
{
Assert.Equal(new RationalNumber(1, 2), new RationalNumber(1, -2).Abs());
}

[Fact(Skip = "Remove to run test")]
public void Absolute_value_of_zero()
{
Expand Down
8 changes: 7 additions & 1 deletion exercises/reverse-string/ReverseStringTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was auto-generated based on version 1.1.0 of the canonical data.
// This file was auto-generated based on version 1.2.0 of the canonical data.

using Xunit;

Expand Down Expand Up @@ -33,4 +33,10 @@ public void A_palindrome()
{
Assert.Equal("racecar", ReverseString.Reverse("racecar"));
}

[Fact(Skip = "Remove to run test")]
public void An_even_sized_word()
{
Assert.Equal("reward", ReverseString.Reverse("drawer"));
}
}
8 changes: 7 additions & 1 deletion exercises/yacht/YachtTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was auto-generated based on version 1.1.0 of the canonical data.
// This file was auto-generated based on version 1.2.0 of the canonical data.

using Xunit;

Expand Down Expand Up @@ -154,6 +154,12 @@ public void Big_straight_as_little_straight()
Assert.Equal(0, YachtGame.Score(new[] { 6, 5, 4, 3, 2 }, YachtCategory.LittleStraight));
}

[Fact(Skip = "Remove to run test")]
public void No_pairs_but_not_a_big_straight()
{
Assert.Equal(0, YachtGame.Score(new[] { 6, 5, 4, 3, 1 }, YachtCategory.BigStraight));
}

[Fact(Skip = "Remove to run test")]
public void Choice()
{
Expand Down