Skip to content

Commit

Permalink
testing replaceAll
Browse files Browse the repository at this point in the history
  • Loading branch information
Serk352 committed May 10, 2019
1 parent de22412 commit bf37d7d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions test/Unosquare.Swan.Test/ExtensionsStringTest.cs
Expand Up @@ -23,20 +23,17 @@ public class Humanize
[TestCase("Yes", true)]
[TestCase("(null)", null)]
[TestCase("12", 12)]
public void WithValidObject_ReturnsHumanizedString(string expected, object input)
{
public void WithValidObject_ReturnsHumanizedString(string expected, object input) =>
Assert.AreEqual(expected, input.Humanize(), $"Testing with {input}");
}
}

[TestFixture]
public class ReplaceAll
{
[TestCase("Camel Case", "CamelCase")]
public void WithValidString_ReturnsStringWithReplacedCharacters(string expected, string input, char[] output)
{
Assert.AreEqual(expected, input.ReplaceAll("Ca", output), $"Testing with {input}");
}
[TestCase("Cam lCas ", "CamelCase", new[] { 'e' }, " ")]
[TestCase("CamelCase", "CxamxelCxaxse", new[] { 'x' }, "")]
public void WithValidString_ReturnsStringWithReplacedCharacters(string expected, string input, char[] toBeReplaced, string toReplace) =>
Assert.AreEqual(expected, input.ReplaceAll(toReplace, toBeReplaced), $"Testing with {input}");
}

[TestFixture]
Expand Down

0 comments on commit bf37d7d

Please sign in to comment.