Exemplo n.º 1
0
 public void 加入空的目錄排除條件_應該拋出例外()
 {
     Assert.Throws <InvalidDirectoryFilterException>(() =>
     {
         var filter = new SearchFilter();
         filter.ExcludeDirectory(string.Empty);
     });
 }
Exemplo n.º 2
0
        public void 目錄先加入接受條件再加入排除條件_符合條件的目錄應該不被接受()
        {
            // Arrange
            var filter = new SearchFilter();

            filter.IncludeDirectory(@"C:\contents");
            filter.ExcludeDirectory(@"C:\contents");

            // Act
            var result = filter.Match(new[] { @"C:\contents\test.dat" });

            // Assert
            Assert.That(result, Is.Empty);
        }