Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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);
                }
            });
        }