public void FileExtensionCompilesToExpectedRegex(Case testCase) { var compiler = new FileExtensionToRegexCompiler(); var regex = compiler.CompileRegex(testCase.Extension, testCase.Casing); Assert.That(regex.ToString(), Is.EqualTo(testCase.ExpectedRegex)); }
public void FileExtensionRejectsExpectedPaths(Case testCase) { var compiler = new FileExtensionToRegexCompiler(); var regex = compiler.CompileRegex(testCase.Extension, testCase.Casing); Assert.Multiple(() => { foreach (var path in testCase.ShouldNotMatch) { Assert.That(regex.IsMatch(path), Is.False); } }); }