-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80ace95
commit 0e5cf86
Showing
7 changed files
with
110 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/NUnit.TestAdapter.Tests.Acceptance/ExplicitIgnoreTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using NUnit.Framework; | ||
using NUnit.VisualStudio.TestAdapter.Tests.Acceptance.WorkspaceTools; | ||
|
||
namespace NUnit.VisualStudio.TestAdapter.Tests.Acceptance; | ||
|
||
public class ExplicitIgnoreTests : CsProjAcceptanceTests | ||
{ | ||
/// <summary> | ||
/// Related to Issue1197. Since we use a category filter, the test with Explicit only should be executed, but not the one with Ignore. | ||
/// https://github.com/nunit/nunit3-vs-adapter/issues/1197. | ||
/// </summary> | ||
protected override void AddTestsCs(IsolatedWorkspace workspace) | ||
{ | ||
workspace.AddFile("Tests.cs", @" | ||
using NUnit.Framework; | ||
namespace TestProject1 | ||
{ | ||
[TestFixture, Category(""MyCustomCategory"")] | ||
[Explicit] | ||
[Ignore(""Ignoring"")] | ||
public class MyTestClass | ||
{ | ||
[Test] | ||
public void MyTest() | ||
{ | ||
Assert.Pass(); | ||
} | ||
} | ||
[TestFixture, Category(""MyCustomCategory"")] | ||
[Explicit] | ||
public class AnotherTestClass | ||
{ | ||
[Test] | ||
public void AnotherTest() | ||
{ | ||
Assert.Pass(); | ||
} | ||
} | ||
} | ||
"); | ||
} | ||
|
||
protected override string Framework => Frameworks.Net80; | ||
|
||
[TestCase("TestCategory=MyCustomCategory", 1, 2)] | ||
public void Filter_DotNetTest(string filter, int executed, int total) | ||
{ | ||
var workspace = Build(); | ||
var results = workspace.DotNetTest(filter, true, true, true, TestContext.WriteLine); | ||
Verify(executed, total, results); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters