public void TestRuleFail() { var rule = new FileDirectoryNameExactMatchRule { Criteria = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "mustfail") }; var fileInfo = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + @"\testfile.txt"); Assert.False(rule.Match(fileInfo)); }
public void TestRuleSucceed() { var rule = new FileDirectoryNameExactMatchRule { Criteria = Path.TrimEndingDirectorySeparator(AppDomain.CurrentDomain.BaseDirectory) }; var fileInfo = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "testfile.txt"); Assert.True(rule.Match(fileInfo)); }
public void TestRuleSucceed() { var rule = new FileDirectoryNameExactMatchRule { Criteria = AppDomain.CurrentDomain.BaseDirectory }; var fileInfo = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + @"\testfile.txt"); Assert.IsTrue(rule.Match(fileInfo)); }