diff --git a/exercises/anagram/AnagramTest.cs b/exercises/anagram/AnagramTest.cs index ccbd6f4f78..a346c824c0 100644 --- a/exercises/anagram/AnagramTest.cs +++ b/exercises/anagram/AnagramTest.cs @@ -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; @@ -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"); diff --git a/exercises/armstrong-numbers/ArmstrongNumbersTest.cs b/exercises/armstrong-numbers/ArmstrongNumbersTest.cs index bbc3cc05ff..f878c0b726 100644 --- a/exercises/armstrong-numbers/ArmstrongNumbersTest.cs +++ b/exercises/armstrong-numbers/ArmstrongNumbersTest.cs @@ -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)); diff --git a/exercises/darts/DartsTest.cs b/exercises/darts/DartsTest.cs index 3cfbbbec96..6c82f48fe4 100644 --- a/exercises/darts/DartsTest.cs +++ b/exercises/darts/DartsTest.cs @@ -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)); } } \ No newline at end of file diff --git a/exercises/diffie-hellman/DiffieHellmanTest.cs b/exercises/diffie-hellman/DiffieHellmanTest.cs index 3cb9ca503c..2f96a8f8fe 100644 --- a/exercises/diffie-hellman/DiffieHellmanTest.cs +++ b/exercises/diffie-hellman/DiffieHellmanTest.cs @@ -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); } } \ No newline at end of file diff --git a/exercises/forth/ForthTest.cs b/exercises/forth/ForthTest.cs index 45ca6398f3..a846e7d763 100644 --- a/exercises/forth/ForthTest.cs +++ b/exercises/forth/ForthTest.cs @@ -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; diff --git a/exercises/luhn/LuhnTest.cs b/exercises/luhn/LuhnTest.cs index f7ea5080a4..d4c6d42b19 100644 --- a/exercises/luhn/LuhnTest.cs +++ b/exercises/luhn/LuhnTest.cs @@ -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; @@ -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")] @@ -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")] @@ -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")); } diff --git a/exercises/pangram/PangramTest.cs b/exercises/pangram/PangramTest.cs index 108caf8392..059892bfdb 100644 --- a/exercises/pangram/PangramTest.cs +++ b/exercises/pangram/PangramTest.cs @@ -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")); } @@ -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")); } diff --git a/exercises/queen-attack/QueenAttackTest.cs b/exercises/queen-attack/QueenAttackTest.cs index 617849966b..d8c025d624 100644 --- a/exercises/queen-attack/QueenAttackTest.cs +++ b/exercises/queen-attack/QueenAttackTest.cs @@ -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; @@ -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)); } } \ No newline at end of file diff --git a/exercises/rational-numbers/RationalNumbersTest.cs b/exercises/rational-numbers/RationalNumbersTest.cs index e9f35ac4ae..ad19fa7baf 100644 --- a/exercises/rational-numbers/RationalNumbersTest.cs +++ b/exercises/rational-numbers/RationalNumbersTest.cs @@ -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; @@ -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() { diff --git a/exercises/reverse-string/ReverseStringTest.cs b/exercises/reverse-string/ReverseStringTest.cs index 611e62c206..557c30b7c9 100644 --- a/exercises/reverse-string/ReverseStringTest.cs +++ b/exercises/reverse-string/ReverseStringTest.cs @@ -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; @@ -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")); + } } \ No newline at end of file diff --git a/exercises/yacht/YachtTest.cs b/exercises/yacht/YachtTest.cs index ffeb4dcf3a..80ec8a1490 100644 --- a/exercises/yacht/YachtTest.cs +++ b/exercises/yacht/YachtTest.cs @@ -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; @@ -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() {