Ejemplo n.º 1
0
 public void 批次加入空的目錄排除條件_應該拋出例外()
 {
     Assert.Throws <InvalidDirectoryFilterException>(() =>
     {
         var filter = new SearchFilter();
         filter.ExcludeDirectories(new[] { string.Empty, @"C:\scripts" });
     });
 }
Ejemplo n.º 2
0
        public void 目錄先批次加入接受條件再加入排除條件_符合條件的目錄應該不被接受()
        {
            // Arrange
            var filter = new SearchFilter();

            filter.IncludeDirectories(new[] { @"C:\contents", @"C:\doc" });
            filter.ExcludeDirectories(new[] { @"C:\contents", @"C:\doc" });

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

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