Skip to content

Commit

Permalink
sync tests (#2255)
Browse files Browse the repository at this point in the history
[no important files changed]
  • Loading branch information
ErikSchierboom authored Apr 24, 2024
1 parent 5ed5ace commit 7cad83a
Show file tree
Hide file tree
Showing 255 changed files with 1,547 additions and 1,687 deletions.
2 changes: 1 addition & 1 deletion exercises/practice/acronym/AcronymTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ public void Underscore_emphasis()
{
Assert.Equal("TRNT", Acronym.Abbreviate("The Road _Not_ Taken"));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/affine-cipher/AffineCipherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ public void Decode_with_a_not_coprime_to_m()
{
Assert.Throws<ArgumentException>(() => AffineCipher.Decode("Test", 13, 5));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/all-your-base/AllYourBaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,4 @@ public void Both_bases_are_negative()
var outputBase = -7;
Assert.Throws<ArgumentException>(() => AllYourBase.Rebase(inputBase, digits, outputBase));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/allergies/AllergiesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,4 @@ public void No_allergen_score_parts_without_highest_valid_score()
var expected = new[] { Allergen.Eggs };
Assert.Equal(expected, sut.List());
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/alphametics/AlphameticsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,4 @@ public void Puzzle_with_ten_letters_and_199_addends()
};
Assert.Equal(expected, actual);
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/anagram/AnagramTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ public void Words_other_than_themselves_can_be_anagrams()
var expected = new[] { "Silent" };
Assert.Equal(expected, sut.FindAnagrams(candidates));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ public void Seven_digit_number_that_is_not_an_armstrong_number()
{
Assert.False(ArmstrongNumbers.IsArmstrongNumber(9926314));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/atbash-cipher/AtbashCipherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ public void Decode_with_no_spaces()
{
Assert.Equal("anobstacleisoftenasteppingstone", AtbashCipher.Decode("zmlyhgzxovrhlugvmzhgvkkrmthglmv"));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/beer-song/BeerSongTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -379,4 +379,4 @@ public void All_verses()
"Go to the store and buy some more, 99 bottles of beer on the wall.";
Assert.Equal(expected, BeerSong.Recite(99, 100));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ public void Can_sort_complex_tree()
var tree = new BinarySearchTree(new[] { 2, 1, 3, 6, 7, 5 });
Assert.Equal(new[] { 1, 2, 3, 5, 6, 7 }, tree.AsEnumerable());
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/binary-search/BinarySearchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ public void Nothing_is_found_when_the_left_and_right_bounds_cross()
var value = 0;
Assert.Equal(-1, BinarySearch.Find(array, value));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/bob/BobTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,4 @@ public void Non_question_ending_with_whitespace()
{
Assert.Equal("Whatever.", Bob.Response("This is a statement ending with whitespace "));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/book-store/BookStoreTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ public void One_group_of_one_and_two_plus_three_groups_of_four_is_cheaper_than_o
var basket = new[] { 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5 };
Assert.Equal(100m, BookStore.Total(basket));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/bowling/BowlingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,4 @@ private void DoRoll(IEnumerable<int> rolls, BowlingGame sut)
sut.Roll(roll);
}
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/change/ChangeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ public void Cannot_find_negative_change_values()
var target = -5;
Assert.Throws<ArgumentException>(() => Change.FindFewestCoins(coins, target));
}
}
}
5 changes: 2 additions & 3 deletions exercises/practice/circular-buffer/CircularBufferTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ public void Read_position_is_maintained_even_across_multiple_writes()
[Fact(Skip = "Remove this Skip property to run this test")]
public void Items_cleared_out_of_buffer_cant_be_read()
{
var buffer = new CircularBuffer<int>(capacity: 3);
var buffer = new CircularBuffer<int>(capacity: 1);
buffer.Write(1);
buffer.Write(2);
buffer.Clear();
Assert.Throws<InvalidOperationException>(() => buffer.Read());
}
Expand Down Expand Up @@ -145,4 +144,4 @@ public void Initial_clear_does_not_affect_wrapping_around()
Assert.Equal(4, buffer.Read());
Assert.Throws<InvalidOperationException>(() => buffer.Read());
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/clock/ClockTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,4 @@ public void Clocks_are_immutable()
var sutPlus1 = sut.Add(1);
Assert.NotEqual(sutPlus1, sut);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ public void Negative_value_is_an_error()
{
Assert.Throws<ArgumentOutOfRangeException>(() => CollatzConjecture.Steps(-15));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/complex-numbers/ComplexNumbersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,4 @@ public void Divide_complex_number_by_real_number()
Assert.Equal(expected.Real(), sut.Div(10).Real(), precision: 7);
Assert.Equal(expected.Imaginary(), sut.Div(10).Imaginary(), precision: 7);
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/connect/ConnectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,4 @@ public void X_wins_using_a_spiral_path()
var sut = new Connect(board);
Assert.Equal(ConnectWinner.Black, sut.Result());
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/crypto-square/CryptoSquareTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ public void Number_54_character_plaintext_results_in_7_chunks_the_last_two_with_
var expected = "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau ";
Assert.Equal(expected, CryptoSquare.Ciphertext(plaintext));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/custom-set/CustomSetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,4 @@ public void Union_of_non_empty_sets_contains_all_unique_elements()
var sut = new CustomSet(new[] { 1, 3 });
Assert.Equal(new CustomSet(new[] { 3, 2, 1 }), sut.Union(set2));
}
}
}
6 changes: 3 additions & 3 deletions exercises/practice/darts/DartsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public void On_the_inner_circle()
}

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

[Fact(Skip = "Remove this Skip property to run this test")]
public void Near_the_centre()
public void Near_the_center()
{
Assert.Equal(10, Darts.Score(-0.1, -0.1));
}
Expand Down Expand Up @@ -79,4 +79,4 @@ public void Asymmetric_position_between_the_inner_and_middle_circles()
{
Assert.Equal(5, Darts.Score(0.5, -4));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ public void Difference_of_squares_100()
{
Assert.Equal(25164150, DifferenceOfSquares.CalculateDifferenceOfSquares(100));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/diffie-hellman/DiffieHellmanTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ public void Key_exchange()
var secretB = DiffieHellman.Secret(p, alicePublicKey, bobPrivateKey);
Assert.Equal(secretA, secretB);
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/dnd-character/DndCharacterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ public void Random_ability_is_distributed_correctly()
foreach (var k in expectedDistribution.Keys)
Assert.InRange(actualDistribution[k], expectedDistribution[k] * minTimes, expectedDistribution[k] * maxTimes);
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/dominoes/DominoesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ public void Separate_three_domino_loops()
var dominoes = new[] { (1, 2), (2, 3), (3, 1), (4, 5), (5, 6), (6, 4) };
Assert.False(Dominoes.CanChain(dominoes));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/etl/EtlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ public void Multiple_scores_with_differing_numbers_of_letters()
};
Assert.Equal(expected, Etl.Transform(input));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/flatten-array/FlattenArrayTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ public void All_values_in_nested_list_are_null()
};
Assert.Empty(FlattenArray.Flatten(array));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/food-chain/FoodChainTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,4 @@ public void Full_song()
"She's dead, of course!";
Assert.Equal(expected, FoodChain.Recite(1, 8));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/forth/ForthTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,4 @@ public void Case_insensitivity_definitions_are_case_insensitive()
{
Assert.Equal("1 1 1 1", Forth.Evaluate(new[] { ": SWAP DUP Dup dup ;", "1 swap" }));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/game-of-life/GameOfLifeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@ public void Bigger_matrix()
};
Assert.Equal(expected, GameOfLife.Tick(matrix));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/gigasecond/GigasecondTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ public void Full_time_with_day_roll_over()
{
Assert.Equal(new DateTime(2046, 10, 3, 1, 46, 39), Gigasecond.Add(new DateTime(2015, 1, 24, 23, 59, 59)));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/go-counting/GoCountingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,4 @@ public void Two_region_rectangular_board()
Assert.Equal(expected[Owner.White], actual[Owner.White]);
Assert.Equal(expected[Owner.None], actual[Owner.None]);
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/grade-school/GradeSchoolTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,4 @@ public void Students_are_sorted_by_name_in_a_grade()
sut.Add("Jeff", 1);
Assert.Equal(expected, sut.Grade(5));
}
}
}
8 changes: 4 additions & 4 deletions exercises/practice/grains/GrainsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ public void Grains_on_square_64()
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void Square_0_raises_an_exception()
public void Square_0_is_invalid()
{
Assert.Throws<ArgumentOutOfRangeException>(() => Grains.Square(0));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void Negative_square_raises_an_exception()
public void Negative_square_is_invalid()
{
Assert.Throws<ArgumentOutOfRangeException>(() => Grains.Square(-1));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void Square_greater_than_64_raises_an_exception()
public void Square_greater_than_64_is_invalid()
{
Assert.Throws<ArgumentOutOfRangeException>(() => Grains.Square(65));
}
Expand All @@ -68,4 +68,4 @@ public void Returns_the_total_number_of_grains_on_the_board()
{
Assert.Equal(18446744073709551615UL, Grains.Total());
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/grep/GrepTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,4 @@ public void Dispose()
File.Delete(MidsummerNightFileName);
File.Delete(ParadiseLostFileName);
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/hamming/HammingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ public void Disallow_empty_second_strand()
{
Assert.Throws<ArgumentException>(() => Hamming.Distance("G", ""));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/hello-world/HelloWorldTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ public void Say_hi_()
{
Assert.Equal("Hello, World!", HelloWorld.Hello());
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/high-scores/HighScoresTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ public void Scores_after_personal_best()
var _ = sut.PersonalBest();
Assert.Equal(new List<int> { 20, 70, 15, 25, 30 }, sut.Scores());
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/house/HouseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ public void Full_rhyme()
"This is the horse and the hound and the horn that belonged to the farmer sowing his corn that kept the rooster that crowed in the morn that woke the priest all shaven and shorn that married the man all tattered and torn that kissed the maiden all forlorn that milked the cow with the crumpled horn that tossed the dog that worried the cat that killed the rat that ate the malt that lay in the house that Jack built.";
Assert.Equal(expected, House.Recite(1, 12));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/isbn-verifier/IsbnVerifierTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ public void Input_is_too_long_but_contains_a_valid_isbn()
{
Assert.False(IsbnVerifier.IsValid("98245726788"));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/isogram/IsogramTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ public void Word_with_duplicated_character_and_with_two_hyphens()
{
Assert.False(Isogram.IsIsogram("up-to-date"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ public void Full_garden_for_larry_last_students_garden()
var sut = new KindergartenGarden("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV");
Assert.Equal(new[] { Plant.Grass, Plant.Violets, Plant.Clover, Plant.Violets }, sut.Plants("Larry"));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/leap/LeapTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ public void Year_divisible_by_200_not_divisible_by_400_in_common_year()
{
Assert.False(Leap.IsLeapYear(1800));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/list-ops/ListOpsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,4 @@ public void Reverse_the_elements_of_the_list_list_of_lists_is_not_flattened()
var expected = new List<List<int>> { new List<int> { 4, 5, 6 }, new List<int>(), new List<int> { 3 }, new List<int> { 1, 2 } };
Assert.Equal(expected, ListOps.Reverse(list));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/luhn/LuhnTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ public void Non_numeric_non_space_char_in_the_middle_with_a_sum_thats_divisible_
{
Assert.False(Luhn.IsValid("59%59"));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/markdown/MarkdownTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ public void Unordered_lists_close_properly_with_preceding_and_following_lines()
var expected = "<h1>Start a list</h1><ul><li>Item 1</li><li>Item 2</li></ul><p>End a list</p>";
Assert.Equal(expected, Markdown.Parse(markdown));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ public void Complex_latex_expression()
var value = "\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)";
Assert.True(MatchingBrackets.IsPaired(value));
}
}
}
2 changes: 1 addition & 1 deletion exercises/practice/matrix/MatrixTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ public void Extract_column_where_numbers_have_different_widths()
var sut = new Matrix("89 1903 3\n18 3 1\n9 4 800");
Assert.Equal(new[] { 1903, 3, 4 }, sut.Column(2));
}
}
}
Loading

0 comments on commit 7cad83a

Please sign in to comment.