mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-15 12:45:01 +00:00
feat: Added RegexUtils method for replacing a single group in a match
This commit is contained in:
38
ICD.Common.Utils.Tests/RegexUtilsTest.cs
Normal file
38
ICD.Common.Utils.Tests/RegexUtilsTest.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace ICD.Common.Utils.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public sealed class RegexUtilsTest
|
||||
{
|
||||
[Test]
|
||||
public static void MatchesTest()
|
||||
{
|
||||
Assert.Inconclusive();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void MatchesOptionsTest()
|
||||
{
|
||||
Assert.Inconclusive();
|
||||
}
|
||||
|
||||
[TestCase(@"[assembly: AssemblyFileVersion(""1.2.3"")][assembly: AssemblyFileVersion(""1.2.3"")]",
|
||||
@"[assembly: AssemblyFileVersion(""2.0.3.0"")][assembly: AssemblyFileVersion(""2.0.3.0"")]",
|
||||
@"AssemblyFileVersion\(""(?<version>(\d+\.?){4})""\)",
|
||||
"version",
|
||||
"1.2.3")]
|
||||
public static void ReplaceGroupTest(string expected, string input, string pattern, string groupName,
|
||||
string replacement)
|
||||
{
|
||||
string result = RegexUtils.ReplaceGroup(input, pattern, groupName, replacement);
|
||||
Assert.AreEqual(expected, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void ReplaceGroupFuncTest()
|
||||
{
|
||||
Assert.Inconclusive();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user