From e7e4f9cf5a96e967883b863c389373e24284cb21 Mon Sep 17 00:00:00 2001 From: Terje Sandstrom Date: Sun, 9 Feb 2025 20:51:58 +0100 Subject: [PATCH 1/6] Add information to explicit tests --- docs/articles/nunit/writing-tests/attributes/explicit.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/articles/nunit/writing-tests/attributes/explicit.md b/docs/articles/nunit/writing-tests/attributes/explicit.md index 5c433eeb8..99c190269 100644 --- a/docs/articles/nunit/writing-tests/attributes/explicit.md +++ b/docs/articles/nunit/writing-tests/attributes/explicit.md @@ -38,6 +38,12 @@ However, the following options will **not** include explicit tests --where cat!=X ``` +## TRAP + +If a project contains only explicit tests, running the test project will execute all tests, as it is treated as an +explicit test run. +To prevent this, ensure the project includes at least one non-explicit test, even if it's just a dummy test. + ## Test Fixture Syntax ### `C#` From b8984182510787311902656d7592411503053ca3 Mon Sep 17 00:00:00 2001 From: Terje Sandstrom Date: Sun, 9 Feb 2025 21:09:39 +0100 Subject: [PATCH 2/6] Add information to explicit tests --- .../nunit/writing-tests/attributes/explicit.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/articles/nunit/writing-tests/attributes/explicit.md b/docs/articles/nunit/writing-tests/attributes/explicit.md index 99c190269..e245c592d 100644 --- a/docs/articles/nunit/writing-tests/attributes/explicit.md +++ b/docs/articles/nunit/writing-tests/attributes/explicit.md @@ -44,6 +44,21 @@ If a project contains only explicit tests, running the test project will execute explicit test run. To prevent this, ensure the project includes at least one non-explicit test, even if it's just a dummy test. +From [this issue](https://github.com/nunit/nunit3-vs-adapter/issues/1223), the following comment explains how the +adapter works with explicit tests: + +*"When the adapter is called from the testhost, it receives a list of tests to run. It doesn't know HOW the Test +Explorer is being used. And thus it has no knowledge if there are other tests present that are not selected, OR if the +tests it receives are all the tests in the solution.* + +*If all the tests are Explicit it will assume that this is an explicit testrun. When you only have one test, and that +test is explicit, it will be an explicit test run.* + +*When you add the second test, which is not explicit, it will see both tests, and since there is a non-explicit test +included, the test is a non-explicit testrun, and all explicit tests will be ignored.* + +*If you have a situation with only one explicit test, the work around is to just add another non-explicit test, which can be empty, or even have a false Assume statement, which will make the test be inconclusive, thus not part of your results."* + ## Test Fixture Syntax ### `C#` From 4c3b310c49a8545d6ae5f00a1a90fe60871a1131 Mon Sep 17 00:00:00 2001 From: Terje Sandstrom Date: Mon, 10 Feb 2025 19:24:46 +0100 Subject: [PATCH 3/6] Add information to explicit tests --- .../nunit/writing-tests/attributes/explicit.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/articles/nunit/writing-tests/attributes/explicit.md b/docs/articles/nunit/writing-tests/attributes/explicit.md index e245c592d..cdc296f00 100644 --- a/docs/articles/nunit/writing-tests/attributes/explicit.md +++ b/docs/articles/nunit/writing-tests/attributes/explicit.md @@ -40,21 +40,20 @@ However, the following options will **not** include explicit tests ## TRAP -If a project contains only explicit tests, running the test project will execute all tests, as it is treated as an -explicit test run. +If a project contains only explicit tests, running the test project will execute all tests, as it is treated as an explicit test run. To prevent this, ensure the project includes at least one non-explicit test, even if it's just a dummy test. -From [this issue](https://github.com/nunit/nunit3-vs-adapter/issues/1223), the following comment explains how the +From [this issue](https://github.com/nunit/nunit3-vs-adapter/issues/1223), the following comment explains how the adapter works with explicit tests: -*"When the adapter is called from the testhost, it receives a list of tests to run. It doesn't know HOW the Test -Explorer is being used. And thus it has no knowledge if there are other tests present that are not selected, OR if the +*"When the adapter is called from the testhost, it receives a list of tests to run. It doesn't know HOW the Test +Explorer is being used. And thus it has no knowledge if there are other tests present that are not selected, OR if the tests it receives are all the tests in the solution.* -*If all the tests are Explicit it will assume that this is an explicit testrun. When you only have one test, and that +*If all the tests are Explicit it will assume that this is an explicit testrun. When you only have one test, and that test is explicit, it will be an explicit test run.* -*When you add the second test, which is not explicit, it will see both tests, and since there is a non-explicit test +*When you add the second test, which is not explicit, it will see both tests, and since there is a non-explicit test included, the test is a non-explicit testrun, and all explicit tests will be ignored.* *If you have a situation with only one explicit test, the work around is to just add another non-explicit test, which can be empty, or even have a false Assume statement, which will make the test be inconclusive, thus not part of your results."* From 6447889f125c037711c6853f3624e515392be5ca Mon Sep 17 00:00:00 2001 From: Terje Sandstrom Date: Mon, 10 Feb 2025 19:27:31 +0100 Subject: [PATCH 4/6] update --- docs/articles/nunit/writing-tests/attributes/explicit.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/articles/nunit/writing-tests/attributes/explicit.md b/docs/articles/nunit/writing-tests/attributes/explicit.md index cdc296f00..cb87eae20 100644 --- a/docs/articles/nunit/writing-tests/attributes/explicit.md +++ b/docs/articles/nunit/writing-tests/attributes/explicit.md @@ -56,7 +56,8 @@ test is explicit, it will be an explicit test run.* *When you add the second test, which is not explicit, it will see both tests, and since there is a non-explicit test included, the test is a non-explicit testrun, and all explicit tests will be ignored.* -*If you have a situation with only one explicit test, the work around is to just add another non-explicit test, which can be empty, or even have a false Assume statement, which will make the test be inconclusive, thus not part of your results."* +*If you have a situation with only one explicit test, the work around is to just add another non-explicit test, which can be empty, + or even have a false Assume statement, which will make the test be inconclusive, thus not part of your results."* ## Test Fixture Syntax From 89dfbc5d5df83475c329990fdd6ff08388c2cc44 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Mon, 10 Feb 2025 18:39:37 +0000 Subject: [PATCH 5/6] Linting fixes --- .../writing-tests/attributes/explicit.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/articles/nunit/writing-tests/attributes/explicit.md b/docs/articles/nunit/writing-tests/attributes/explicit.md index cb87eae20..7f9ab8254 100644 --- a/docs/articles/nunit/writing-tests/attributes/explicit.md +++ b/docs/articles/nunit/writing-tests/attributes/explicit.md @@ -40,8 +40,9 @@ However, the following options will **not** include explicit tests ## TRAP -If a project contains only explicit tests, running the test project will execute all tests, as it is treated as an explicit test run. -To prevent this, ensure the project includes at least one non-explicit test, even if it's just a dummy test. +If a project contains only explicit tests, running the test project will execute all tests, as it is treated as an +explicit test run. To prevent this, ensure the project includes at least one non-explicit test, even if it's just a +dummy test. From [this issue](https://github.com/nunit/nunit3-vs-adapter/issues/1223), the following comment explains how the adapter works with explicit tests: @@ -56,12 +57,13 @@ test is explicit, it will be an explicit test run.* *When you add the second test, which is not explicit, it will see both tests, and since there is a non-explicit test included, the test is a non-explicit testrun, and all explicit tests will be ignored.* -*If you have a situation with only one explicit test, the work around is to just add another non-explicit test, which can be empty, - or even have a false Assume statement, which will make the test be inconclusive, thus not part of your results."* +*If you have a situation with only one explicit test, the work around is to just add another non-explicit test, which +can be empty, or even have a false Assume statement, which will make the test be inconclusive, thus not part of your +results."* ## Test Fixture Syntax -### `C#` +C#: ```csharp namespace NUnit.Tests @@ -77,7 +79,7 @@ namespace NUnit.Tests } ``` -### Visual Basic +Visual Basic: ```VB Imports System @@ -92,7 +94,7 @@ Namespace NUnit.Tests End Namespace ``` -### C++ +C++: ```cpp using namespace System; @@ -117,7 +119,7 @@ namespace NUnitTests { ## Test Syntax -### `C#` +C#: ```csharp namespace NUnit.Tests @@ -134,7 +136,7 @@ namespace NUnit.Tests } ``` -### Visual Basic +Visual Basic: ```vb Imports System @@ -150,7 +152,7 @@ Namespace NUnit.Tests End Namespace ``` -### C++ +C++: ```cpp # using From 9642b5ed03c0e4e841109963438c17f3ab187634 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Mon, 10 Feb 2025 18:54:44 +0000 Subject: [PATCH 6/6] Auto-fix markdownlint issues --- .vscode/settings.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index b6cc11639..1058d3f38 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -20,4 +20,7 @@ "editor.wrappingIndent": "same", "editor.wordWrapColumn": 120, "editor.rulers": [120], + "editor.codeActionsOnSave": { + "source.fixAll.markdownlint": "always" + } } \ No newline at end of file