diff --git a/docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md b/docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md new file mode 100644 index 000000000..014dd65e6 --- /dev/null +++ b/docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md @@ -0,0 +1,47 @@ +# NUnit and Microsoft Test Platform + +## Overview + +Microsoft Test Platform (MTP) is the new platform for testing from Microsoft. Test projects can be run as +executables, as with [NUnitLite](../nunit/running-tests/NUnitLite-Runner.md) currently. There is no longer a test +runner; the executable _is_ the test runner. + +It will take time to develop feature parity with NUnit's current system, and there are many historical factors to +consider. But, the NUnit team recognizes that in the meantime, there needs to be a bridge between these two. In NUnit, +the NUnit3TestAdapter contains what is necessary to run the MTP using the same old test runners. + +This means we have two modes of MTP operation: either use the new platform but not as an executable, or use it +as an executable too. + +## Changing a Project to Use MTP + +To change a current test project to use MTP, you need to use version 5.0 or greater of the NUnit3TestAdapter. + +Note that this version can run both with and without MTP, and you can easily switch between them by setting two project +properties. + +In a property group (use the top-level one), add the following two properties: + +```xml + true + Exe +``` + +The first property, `EnableNUnitRunner`, enables the MTP. The second enables it to also run as an executable (but it +doesn't prevent you from using it in Test Explorer or through `dotnet test`. + +## Information on the Microsoft Test Platform + +* [Microsoft Test Platform](https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-platform-intro?tabs=dotnetcli) +* [NUnit Samples](https://github.com/nunit/nunit3-vs-adapter.issues/tree/master/Issue1152) +* [Adapter issue for implementing MTP](https://github.com/nunit/nunit3-vs-adapter/issues/1152) + +## Known issues + +In the current (v5) version of the NUnit3TestAdapter, running single tests doesn't work. It will always run all tests. +See [Adapter Issue 1232](https://github.com/nunit/nunit3-vs-adapter/issues/1232). + +This applies to both Test Explorer and `dotnet test`. + +As a workaround for the latter, you can filter tests using MTP-specific commands +like `dotnet test -- --filter Name=Test1`. diff --git a/docs/articles/vs-test-adapter/toc.yml b/docs/articles/vs-test-adapter/toc.yml index a3f9db429..e1391b90d 100644 --- a/docs/articles/vs-test-adapter/toc.yml +++ b/docs/articles/vs-test-adapter/toc.yml @@ -10,6 +10,8 @@ href: Known-Problems.md - name: Configuration with runsettings href: Tips-And-Tricks.md +- name: Microsoft Test Platform (MTP) + href: NUnit-And-Microsoft-Test-Platform.md - name: Trace And Debug Output href: Trace-and-Debug.md - name: Supported Frameworks