Skip to content

Commit

Permalink
Fix test naming
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom committed Jan 28, 2025
1 parent 8ddd860 commit 9243874
Show file tree
Hide file tree
Showing 24 changed files with 145 additions and 233 deletions.
12 changes: 6 additions & 6 deletions exercises/practice/acronym/AcronymTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public void Basic()
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void LowercaseWords()
public void Lowercase_words()
{
Assert.Equal("ROR", Acronym.Abbreviate("Ruby on Rails"));
}
Expand All @@ -21,25 +21,25 @@ public void Punctuation()
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void AllCapsWord()
public void All_caps_word()
{
Assert.Equal("GIMP", Acronym.Abbreviate("GNU Image Manipulation Program"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void PunctuationWithoutWhitespace()
public void Punctuation_without_whitespace()
{
Assert.Equal("CMOS", Acronym.Abbreviate("Complementary metal-oxide semiconductor"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void VeryLongAbbreviation()
public void Very_long_abbreviation()
{
Assert.Equal("ROTFLSHTMDCOALM", Acronym.Abbreviate("Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void ConsecutiveDelimiters()
public void Consecutive_delimiters()
{
Assert.Equal("SIMUFTA", Acronym.Abbreviate("Something - I made up from thin air"));
}
Expand All @@ -51,7 +51,7 @@ public void Apostrophes()
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void UnderscoreEmphasis()
public void Underscore_emphasis()
{
Assert.Equal("TRNT", Acronym.Abbreviate("The Road _Not_ Taken"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,55 @@
public class DifferenceOfSquaresTests
{
[Fact]
public void SquareOfSum1()
public void Square_of_sum1()
{
Assert.Equal(1, DifferenceOfSquares.CalculateSquareOfSum(1));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void SquareOfSum5()
public void Square_of_sum5()
{
Assert.Equal(225, DifferenceOfSquares.CalculateSquareOfSum(5));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void SquareOfSum100()
public void Square_of_sum100()
{
Assert.Equal(25502500, DifferenceOfSquares.CalculateSquareOfSum(100));
}

[Fact]
public void SumOfSquares1()
public void Sum_of_squares1()
{
Assert.Equal(1, DifferenceOfSquares.CalculateSumOfSquares(1));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void SumOfSquares5()
public void Sum_of_squares5()
{
Assert.Equal(55, DifferenceOfSquares.CalculateSumOfSquares(5));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void SumOfSquares100()
public void Sum_of_squares100()
{
Assert.Equal(338350, DifferenceOfSquares.CalculateSumOfSquares(100));
}

[Fact]
public void DifferenceOfSquares1()
public void Difference_of_squares1()
{
Assert.Equal(0, DifferenceOfSquares.CalculateDifferenceOfSquares(1));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void DifferenceOfSquares5()
public void Difference_of_squares5()
{
Assert.Equal(170, DifferenceOfSquares.CalculateDifferenceOfSquares(5));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void DifferenceOfSquares100()
public void Difference_of_squares100()
{
Assert.Equal(25164150, DifferenceOfSquares.CalculateDifferenceOfSquares(100));
}
Expand Down
8 changes: 4 additions & 4 deletions exercises/practice/eliuds-eggs/EliudsEggsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
public class EliudsEggsTests
{
[Fact]
public void ZeroEggs()
public void Zero_eggs()
{
Assert.Equal(0, EliudsEggs.EggCount(0));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void OneEgg()
public void One_egg()
{
Assert.Equal(1, EliudsEggs.EggCount(16));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void FourEggs()
public void Four_eggs()
{
Assert.Equal(4, EliudsEggs.EggCount(89));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void ThirteenEggs()
public void Thirteen_eggs()
{
Assert.Equal(13, EliudsEggs.EggCount(2000000000));
}
Expand Down
18 changes: 9 additions & 9 deletions exercises/practice/hamming/HammingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,55 @@
public class HammingTests
{
[Fact]
public void EmptyStrands()
public void Empty_strands()
{
Assert.Equal(0, Hamming.Distance("", ""));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void SingleLetterIdenticalStrands()
public void Single_letter_identical_strands()
{
Assert.Equal(0, Hamming.Distance("A", "A"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void SingleLetterDifferentStrands()
public void Single_letter_different_strands()
{
Assert.Equal(1, Hamming.Distance("G", "T"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void LongIdenticalStrands()
public void Long_identical_strands()
{
Assert.Equal(0, Hamming.Distance("GGACTGAAATCTG", "GGACTGAAATCTG"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void LongDifferentStrands()
public void Long_different_strands()
{
Assert.Equal(9, Hamming.Distance("GGACGGATTCTG", "AGGACGGATTCT"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void DisallowFirstStrandLonger()
public void Disallow_first_strand_longer()
{
Assert.Throws<ArgumentException>(() => Hamming.Distance("AATG", "AAA"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void DisallowSecondStrandLonger()
public void Disallow_second_strand_longer()
{
Assert.Throws<ArgumentException>(() => Hamming.Distance("ATA", "AGTG"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void DisallowEmptyFirstStrand()
public void Disallow_empty_first_strand()
{
Assert.Throws<ArgumentException>(() => Hamming.Distance("", "G"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void DisallowEmptySecondStrand()
public void Disallow_empty_second_strand()
{
Assert.Throws<ArgumentException>(() => Hamming.Distance("G", ""));
}
Expand Down
28 changes: 14 additions & 14 deletions exercises/practice/isogram/IsogramTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,85 +3,85 @@
public class IsogramTests
{
[Fact]
public void EmptyString()
public void Empty_string()
{
Assert.True(Isogram.IsIsogram(""));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void IsogramWithOnlyLowerCaseCharacters()
public void Isogram_with_only_lower_case_characters()
{
Assert.True(Isogram.IsIsogram("isogram"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void WordWithOneDuplicatedCharacter()
public void Word_with_one_duplicated_character()
{
Assert.False(Isogram.IsIsogram("eleven"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void WordWithOneDuplicatedCharacterFromTheEndOfTheAlphabet()
public void Word_with_one_duplicated_character_from_the_end_of_the_alphabet()
{
Assert.False(Isogram.IsIsogram("zzyzx"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void LongestReportedEnglishIsogram()
public void Longest_reported_english_isogram()
{
Assert.True(Isogram.IsIsogram("subdermatoglyphic"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void WordWithDuplicatedCharacterInMixedCase()
public void Word_with_duplicated_character_in_mixed_case()
{
Assert.False(Isogram.IsIsogram("Alphabet"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void WordWithDuplicatedCharacterInMixedCaseLowercaseFirst()
public void Word_with_duplicated_character_in_mixed_case_lowercase_first()
{
Assert.False(Isogram.IsIsogram("alphAbet"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void HypotheticalIsogrammicWordWithHyphen()
public void Hypothetical_isogrammic_word_with_hyphen()
{
Assert.True(Isogram.IsIsogram("thumbscrew-japingly"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void HypotheticalWordWithDuplicatedCharacterFollowingHyphen()
public void Hypothetical_word_with_duplicated_character_following_hyphen()
{
Assert.False(Isogram.IsIsogram("thumbscrew-jappingly"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void IsogramWithDuplicatedHyphen()
public void Isogram_with_duplicated_hyphen()
{
Assert.True(Isogram.IsIsogram("six-year-old"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void MadeUpNameThatIsAnIsogram()
public void Made_up_name_that_is_an_isogram()
{
Assert.True(Isogram.IsIsogram("Emily Jung Schwartzkopf"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void DuplicatedCharacterInTheMiddle()
public void Duplicated_character_in_the_middle()
{
Assert.False(Isogram.IsIsogram("accentor"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void SameFirstAndLastCharacters()
public void Same_first_and_last_characters()
{
Assert.False(Isogram.IsIsogram("angola"));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void WordWithDuplicatedCharacterAndWithTwoHyphens()
public void Word_with_duplicated_character_and_with_two_hyphens()
{
Assert.False(Isogram.IsIsogram("up-to-date"));
}
Expand Down
18 changes: 9 additions & 9 deletions exercises/practice/leap/LeapTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,55 @@
public class LeapTests
{
[Fact]
public void YearNotDivisibleBy4InCommonYear()
public void Year_not_divisible_by4_in_common_year()
{
Assert.False(Leap.IsLeapYear(2015));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void YearDivisibleBy2NotDivisibleBy4InCommonYear()
public void Year_divisible_by2_not_divisible_by4_in_common_year()
{
Assert.False(Leap.IsLeapYear(1970));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void YearDivisibleBy4NotDivisibleBy100InLeapYear()
public void Year_divisible_by4_not_divisible_by100_in_leap_year()
{
Assert.True(Leap.IsLeapYear(1996));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void YearDivisibleBy4And5IsStillALeapYear()
public void Year_divisible_by4_and5_is_still_a_leap_year()
{
Assert.True(Leap.IsLeapYear(1960));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void YearDivisibleBy100NotDivisibleBy400InCommonYear()
public void Year_divisible_by100_not_divisible_by400_in_common_year()
{
Assert.False(Leap.IsLeapYear(2100));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void YearDivisibleBy100ButNotBy3IsStillNotALeapYear()
public void Year_divisible_by100_but_not_by3_is_still_not_a_leap_year()
{
Assert.False(Leap.IsLeapYear(1900));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void YearDivisibleBy400IsLeapYear()
public void Year_divisible_by400_is_leap_year()
{
Assert.True(Leap.IsLeapYear(2000));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void YearDivisibleBy400ButNotBy125IsStillALeapYear()
public void Year_divisible_by400_but_not_by125_is_still_a_leap_year()
{
Assert.True(Leap.IsLeapYear(2400));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void YearDivisibleBy200NotDivisibleBy400InCommonYear()
public void Year_divisible_by200_not_divisible_by400_in_common_year()
{
Assert.False(Leap.IsLeapYear(1800));
}
Expand Down
Loading

0 comments on commit 9243874

Please sign in to comment.