Removes IShortStringHelper.ReplaceMany, this should just be a normal string extension and removes the need to load in IUmbracoSettings for this simple purpose, this fixes some unit tests
This commit is contained in:
@@ -596,32 +596,7 @@ namespace Umbraco.Tests.Strings
|
||||
Assert.AreEqual(expected, output);
|
||||
}
|
||||
|
||||
[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" },
|
||||
{ " ", " " },
|
||||
};
|
||||
var output = _helper.ReplaceMany(input, replacements);
|
||||
Assert.AreEqual(expected, output);
|
||||
}
|
||||
|
||||
#region Cases
|
||||
[TestCase("val$id!ate|this|str'ing", "$!'", '-', "val-id-ate|this|str-ing")]
|
||||
[TestCase("val$id!ate|this|str'ing", "$!'", '*', "val*id*ate|this|str*ing")]
|
||||
#endregion
|
||||
public void ReplaceManyByOneChar(string input, string toReplace, char replacement, string expected)
|
||||
{
|
||||
var output = _helper.ReplaceMany(input, toReplace.ToArray(), replacement);
|
||||
Assert.AreEqual(expected, output);
|
||||
}
|
||||
|
||||
|
||||
#region Cases
|
||||
[TestCase("foo.txt", "foo.txt")]
|
||||
|
||||
Reference in New Issue
Block a user