test: Adding test case for RemoveCharacters string extension method

This commit is contained in:
Chris Cameron
2018-11-09 10:09:40 -05:00
parent 2e2eebd95f
commit c048c4fc65

View File

@@ -1,4 +1,5 @@
using System.Linq; using System.Collections.Generic;
using System.Linq;
using ICD.Common.Utils.Extensions; using ICD.Common.Utils.Extensions;
using NUnit.Framework; using NUnit.Framework;
@@ -57,10 +58,11 @@ namespace ICD.Common.Utils.Tests.Extensions
Assert.AreEqual(expected, value.RemoveWhitespace()); Assert.AreEqual(expected, value.RemoveWhitespace());
} }
[Test] [TestCase("1234567890", new[] {'2', '6'}, "13457890")]
public void RemoveCharactersTest() [TestCase("912529434324", new[] {'-', '(', ')', '.', '+'}, "912529434324")]
public void RemoveCharactersTest(string value, IEnumerable<char> characters, string expected)
{ {
Assert.AreEqual("13457890", "1234567890".Remove(new[] { '2', '6' })); Assert.AreEqual(expected, value.Remove(characters));
} }
[TestCase(true, "27652")] [TestCase(true, "27652")]