diff --git a/src/Compiler/Input/Filter/ExcludeFileFilter.cs b/src/Compiler/Input/Filter/ExcludeFileFilter.cs index d6742d38..442429ae 100644 --- a/src/Compiler/Input/Filter/ExcludeFileFilter.cs +++ b/src/Compiler/Input/Filter/ExcludeFileFilter.cs @@ -8,7 +8,7 @@ public ExcludeFileFilter(IEnumerable fileNames) : base(fileNames) { } - public new bool Filter(string path) + public override bool Filter(string path) { return !base.Filter(path); } diff --git a/src/Compiler/Input/Filter/IncludeFileFilter.cs b/src/Compiler/Input/Filter/IncludeFileFilter.cs index 7121bf1f..6c1d4f2d 100644 --- a/src/Compiler/Input/Filter/IncludeFileFilter.cs +++ b/src/Compiler/Input/Filter/IncludeFileFilter.cs @@ -13,7 +13,7 @@ public IncludeFileFilter(IEnumerable fileNames) FileNames = fileNames; } - public bool Filter(string path) + public virtual bool Filter(string path) { return FileNames.Contains(Path.GetFileName(path)); } diff --git a/tests/CompilerTest/Input/Filter/ExcludeFileFilterTest.cs b/tests/CompilerTest/Input/Filter/ExcludeFileFilterTest.cs index 3766af01..342b80f5 100644 --- a/tests/CompilerTest/Input/Filter/ExcludeFileFilterTest.cs +++ b/tests/CompilerTest/Input/Filter/ExcludeFileFilterTest.cs @@ -28,5 +28,13 @@ public void ItDoesntFilterIfNotMatch() filter.Filter("_TestData/abc/NotFoo.txt") ); } + + [Fact] + public void ItOverridesBaseFilter() + { + Assert.False( + ((IFileFilter) filter).Filter("_TestData/abc/Foo.txt") + ); + } } }