Ejemplo n.º 1
0
        [Test] // can't do cases with an IDictionary
        public void ReplaceManyWithCharMap()
        {
            const string input    = "télévisiön tzvâr ßup   pof";
            const string expected = "television tzvar ssup   pof";
            IDictionary <string, string> replacements = new Dictionary <string, string>
            {
                { "é", "e" },
                { "ö", "o" },
                { "â", "a" },
                { "ß", "ss" },
                { "&nbsp;", " " },
            };
            var output = _helper.ReplaceMany(input, replacements);

            Assert.AreEqual(expected, output);
        }
 public void ReplaceManyByOneChar(string input, string toReplace, char replacement, string expected)
 {
     var output = _helper.ReplaceMany(input, toReplace.ToArray(), replacement);
     Assert.AreEqual(expected, output);
 }