Skip to content

Commit

Permalink
Add some test for exclude filters with namespaces (#579)
Browse files Browse the repository at this point in the history
Add some test for exclude filters with namespaces
  • Loading branch information
MarcoRossignoli authored Oct 5, 2019
1 parent 0614f87 commit 026c74a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/coverlet.core.tests/Helpers/InstrumentationHelperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,22 @@ public void TestIsTypeExcludedWithoutFilter()
Assert.False(result);
}

[Fact]
public void TestIsTypeExcludedNamespace()
{
var result = _instrumentationHelper.IsTypeExcluded("Module.dll", "Namespace.Namespace.Type", new string[]{ "[Module]Namespace.Namespace.*" });
Assert.True(result);

result = _instrumentationHelper.IsTypeExcluded("Module.dll", "Namespace.Namespace.TypeB", new string[] { "[Module]Namespace.Namespace.*" });
Assert.True(result);

result = _instrumentationHelper.IsTypeExcluded("Module.dll", "Namespace.Namespace.Type", new string[] { "[Module]Namespace.*" });
Assert.True(result);

result = _instrumentationHelper.IsTypeExcluded("Module.dll", "Namespace.Namespace.Type", new string[] { "[Module]Namespace.WrongNamespace.*" });
Assert.False(result);
}

[Fact]
public void TestIsTypeIncludedWithoutFilter()
{
Expand Down

0 comments on commit 026c74a

Please sign in to comment.