Skip to content

Commit

Permalink
Added test for longer replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Dec 26, 2022
1 parent c9f77c6 commit ca5a7eb
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void ShouldReplaceAllText()
}

[Fact]
public void ShouldReplacePart()
public void ShouldReplacePartThatIsShorter()
{
using var builder = new ValueStringBuilder("Hello World");

Expand All @@ -67,6 +67,16 @@ public void ShouldReplacePart()
builder.ToString().Should().Be("Ha World");
}

[Fact]
public void ShouldReplacePartThatIsLonger()
{
using var builder = new ValueStringBuilder("Hello World");

builder.Replace("Hello", "Hallöchen");

builder.ToString().Should().Be("Hallöchen World");
}

[Theory]
[InlineData("", "word")]
[InlineData("word", "")]
Expand Down

0 comments on commit ca5a7eb

Please sign in to comment.