Skip to content

Commit

Permalink
style(tests): use more meaningful test names
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbooth committed Aug 27, 2023
1 parent dc0b6ab commit da08d23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions X10D.Tests/src/Text/CharTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void IsEmoji_ShouldReturnFalse_GivenNonEmoji()
}

[Test]
public void RepeatShouldBeCorrect()
public void Repeat_ShouldReturnRepeatedCharacter_GivenValidCount()
{
const string expected = "aaaaaaaaaa";
string actual = 'a'.Repeat(10);
Expand All @@ -38,21 +38,21 @@ public void RepeatShouldBeCorrect()
}

[Test]
public void RepeatOneCountShouldBeLength1String()
public void Repeat_ShouldReturnSingleCharString_GivenCount1()
{
string repeated = 'a'.Repeat(1);
Assert.That(repeated, Has.Length.EqualTo(1));
Assert.That(repeated, Is.EqualTo("a"));
}

[Test]
public void RepeatZeroCountShouldBeEmpty()
public void Repeat_ShouldReturnEmptyString_GivenCount0()
{
Assert.That('a'.Repeat(0), Is.EqualTo(string.Empty));
}

[Test]
public void RepeatNegativeCountShouldThrow()
public void Repeat_ShouldThrowArgumentOutOfRangeException_GivenNegativeCount()
{
Assert.Throws<ArgumentOutOfRangeException>(() => _ = 'a'.Repeat(-1));
}
Expand Down

0 comments on commit da08d23

Please sign in to comment.