public void Should_replace_space_by_percent20(string input, string ExpectedResult) { var arr = input.ToCharArray(); var result = new Q1_03_URLify().URLify(arr, input.Trim().Length); Assert.AreEqual(result, ExpectedResult); }
//[TestCase("Mr John Smith", "Mr%20John%20Smith")] //[TestCase("Mr John Smith ", "Mr%20John%20Smith")] //[TestCase("abc", "abc")] //[TestCase("ab c", "ab%20c")] //[TestCase(" ", "%20")] // Failed //[TestCase(null, null)] // Failed public void Should_Replace_space_by_percent20(string input, string expected) { string result = new Q1_03_URLify().UrlifySpace(input.Trim()); Assert.That(result, Is.EqualTo(expected)); }