Skip to content

Commit

Permalink
add information on the new Microsoft Test Platform (#1013)
Browse files Browse the repository at this point in the history
* add information on the new Microsoft Test Platform

* add information on the new Microsoft Test Platform

* add information on the new Microsoft Test Platform

* add information on the new Microsoft Test Platform

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* add information on the new Microsoft Test Platform

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Added toc entry

* Added toc entry

* phrasing update

* more

* errant space

* final touches

---------

Co-authored-by: Sean Killeen <[email protected]> e0b5d9f
  • Loading branch information
SeanKilleen committed Feb 3, 2025
1 parent f3a54de commit e3c9fdb
Show file tree
Hide file tree
Showing 8 changed files with 896 additions and 709 deletions.
3 changes: 3 additions & 0 deletions articles/toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,9 @@
<li>
<a href="vs-test-adapter/Tips-And-Tricks.html" name="" title="Configuration with runsettings">Configuration with runsettings</a>
</li>
<li>
<a href="vs-test-adapter/NUnit-And-Microsoft-Test-Platform.html" name="" title="Microsoft Test Platform (MTP)">Microsoft Test Platform (MTP)</a>
</li>
<li>
<a href="vs-test-adapter/Trace-and-Debug.html" name="" title="Trace And Debug Output">Trace And Debug Output</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion articles/toc.json

Large diffs are not rendered by default.

160 changes: 160 additions & 0 deletions articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html lang="en">

<head>
<meta charset="utf-8">
<script async="" src="https://www.googletagmanager.com/gtag/js?id=G-PCB5BYBNM2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-PCB5BYBNM2');
</script>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>NUnit and Microsoft Test Platform | NUnit Docs </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="NUnit and Microsoft Test Platform | NUnit Docs ">


<link rel="shortcut icon" href="../../favicon.ico">
<link rel="stylesheet" href="../../styles/docfx.vendor.min.css">
<link rel="stylesheet" href="../../styles/docfx.css">
<link rel="stylesheet" href="../../styles/main.css">
<meta property="docfx:navrel" content="../../toc.html">
<meta property="docfx:tocrel" content="../toc.html">

<meta property="docfx:rel" content="../../">

</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>

<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>

<a class="navbar-brand" href="../../index.html">
<img id="logo" class="svg" src="../../logo.svg" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>

<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div class="container body-content">

<div id="search-results">
<div class="search-list">Search Results for <span></span></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">

<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="">
<h1 id="nunit-and-microsoft-test-platform">NUnit and Microsoft Test Platform</h1>

<h2 id="overview">Overview</h2>
<p>Microsoft Test Platform (MTP) is the new platform for testing from Microsoft. Test projects can be run as
executables, as with <a href="../nunit/running-tests/NUnitLite-Runner.html">NUnitLite</a> currently. There is no longer a test
runner; the executable <em>is</em> the test runner.</p>
<p>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.</p>
<p>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.</p>
<h2 id="changing-a-project-to-use-mtp">Changing a Project to Use MTP</h2>
<p>To change a current test project to use MTP, you need to use version 5.0 or greater of the NUnit3TestAdapter.</p>
<p>Note that this version can run both with and without MTP, and you can easily switch between them by setting two project
properties.</p>
<p>In a property group (use the top-level one), add the following two properties:</p>
<pre><code class="lang-xml"> &lt;EnableNUnitRunner&gt;true&lt;/EnableNUnitRunner&gt;
&lt;OutputType&gt;Exe&lt;/OutputType&gt;
</code></pre>
<p>The first property, <code>EnableNUnitRunner</code>, 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 <code>dotnet test</code>.</p>
<h2 id="information-on-the-microsoft-test-platform">Information on the Microsoft Test Platform</h2>
<ul>
<li><a href="https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-platform-intro?tabs=dotnetcli">Microsoft Test Platform</a></li>
<li><a href="https://github.com/nunit/nunit3-vs-adapter.issues/tree/master/Issue1152">NUnit Samples</a></li>
<li><a href="https://github.com/nunit/nunit3-vs-adapter/issues/1152">Adapter issue for implementing MTP</a></li>
</ul>
<h2 id="known-issues">Known issues</h2>
<p>In the current (v5) version of the NUnit3TestAdapter, running single tests doesn't work. It will always run all tests.
See <a href="https://github.com/nunit/nunit3-vs-adapter/issues/1232">Adapter Issue 1232</a>.</p>
<p>This applies to both Test Explorer and <code>dotnet test</code>.</p>
<p>As a workaround for the latter, you can filter tests using MTP-specific commands
like <code>dotnet test -- --filter Name=Test1</code>.</p>

</article>
</div>

<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
<li>
<a href="https://github.com/nunit/docs/blob/master/docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md/#L1" class="contribution-link">Edit this page</a>
</li>
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<h5>In this article</h5>
<div></div>
</nav>
</div>
</div>
</div>
</div>

<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
<span>Generated by <strong>DocFX</strong></span> | Copyright (c) 2018-<span id="currentYear"></span> The NUnit Project - Licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a>

</div>
</div>
</footer>
</div>

<script type="text/javascript" src="../../styles/docfx.vendor.min.js"></script>
<script type="text/javascript" src="../../styles/docfx.js"></script>
<script type="text/javascript" src="../../styles/main.js"></script>
</body>
</html>
3 changes: 3 additions & 0 deletions articles/vs-test-adapter/toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<li>
<a href="Tips-And-Tricks.html" name="" title="Configuration with runsettings">Configuration with runsettings</a>
</li>
<li>
<a href="NUnit-And-Microsoft-Test-Platform.html" name="" title="Microsoft Test Platform (MTP)">Microsoft Test Platform (MTP)</a>
</li>
<li>
<a href="Trace-and-Debug.html" name="" title="Trace And Debug Output">Trace And Debug Output</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion articles/vs-test-adapter/toc.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

{"order":100,"items":[{"name":"Visual Studio Test Adapter","href":"Index.html","topicHref":"Index.html"},{"name":"Installation","href":"Adapter-Installation.html","topicHref":"Adapter-Installation.html"},{"name":"Usage","href":"Usage.html","topicHref":"Usage.html"},{"name":"Resources","href":"Resources.html","topicHref":"Resources.html"},{"name":"Known Problems","href":"Known-Problems.html","topicHref":"Known-Problems.html"},{"name":"Configuration with runsettings","href":"Tips-And-Tricks.html","topicHref":"Tips-And-Tricks.html"},{"name":"Trace And Debug Output","href":"Trace-and-Debug.html","topicHref":"Trace-and-Debug.html"},{"name":"Supported Frameworks","href":"Supported-Frameworks.html","topicHref":"Supported-Frameworks.html"},{"name":"Adapter-Engine Compatibility","href":"Adapter-Engine-Compatibility.html","topicHref":"Adapter-Engine-Compatibility.html"},{"name":"Debugging the Adapter","href":"Debugging.html","topicHref":"Debugging.html"},{"name":"Debugger Source-Stepping","href":"Adapter-Source-Stepping.html","topicHref":"Adapter-Source-Stepping.html"},{"name":"Release Notes V4","href":"AdapterV4-Release-Notes.html","topicHref":"AdapterV4-Release-Notes.html"},{"name":"Release Notes V3","href":"AdapterV3-Release-Notes.html","topicHref":"AdapterV3-Release-Notes.html"},{"name":"Release Notes V2","href":"AdapterV2-Release-Notes.html","topicHref":"AdapterV2-Release-Notes.html"},{"name":"License","href":"Adapter-License.html","topicHref":"Adapter-License.html"}]}
{"order":100,"items":[{"name":"Visual Studio Test Adapter","href":"Index.html","topicHref":"Index.html"},{"name":"Installation","href":"Adapter-Installation.html","topicHref":"Adapter-Installation.html"},{"name":"Usage","href":"Usage.html","topicHref":"Usage.html"},{"name":"Resources","href":"Resources.html","topicHref":"Resources.html"},{"name":"Known Problems","href":"Known-Problems.html","topicHref":"Known-Problems.html"},{"name":"Configuration with runsettings","href":"Tips-And-Tricks.html","topicHref":"Tips-And-Tricks.html"},{"name":"Microsoft Test Platform (MTP)","href":"NUnit-And-Microsoft-Test-Platform.html","topicHref":"NUnit-And-Microsoft-Test-Platform.html"},{"name":"Trace And Debug Output","href":"Trace-and-Debug.html","topicHref":"Trace-and-Debug.html"},{"name":"Supported Frameworks","href":"Supported-Frameworks.html","topicHref":"Supported-Frameworks.html"},{"name":"Adapter-Engine Compatibility","href":"Adapter-Engine-Compatibility.html","topicHref":"Adapter-Engine-Compatibility.html"},{"name":"Debugging the Adapter","href":"Debugging.html","topicHref":"Debugging.html"},{"name":"Debugger Source-Stepping","href":"Adapter-Source-Stepping.html","topicHref":"Adapter-Source-Stepping.html"},{"name":"Release Notes V4","href":"AdapterV4-Release-Notes.html","topicHref":"AdapterV4-Release-Notes.html"},{"name":"Release Notes V3","href":"AdapterV3-Release-Notes.html","topicHref":"AdapterV3-Release-Notes.html"},{"name":"Release Notes V2","href":"AdapterV2-Release-Notes.html","topicHref":"AdapterV2-Release-Notes.html"},{"name":"License","href":"Adapter-License.html","topicHref":"Adapter-License.html"}]}
5 changes: 5 additions & 0 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3489,6 +3489,11 @@
"title": "Known Problems | NUnit Docs",
"keywords": "Known Problems Using both the VSIX adapter and nuget adapters at the same time can lead to discovery issues; see nunit3-vs-adapter/issues #769. The resolution is to uninstall the VSIX adapter, and only use the nuget adapters. The VSIX adapters are being deprecated in later VS versions. Support for Explicit keyword 1 Adapter versions in the 4.XX series support the explicit keyword in all Visual Studio versions. 2 Adapter versions in the 3.XX series: From version 16.2 (Visual Studio 2019) the Explicit keyword is no longer explicitly supported by Visual Studio. If you want to use it, it does exist as a Category, so you can use it as a category filter. There is no test status in Visual Studio corresponding to NUnit's Inconclusive result, so tests with this result are reported as Not Run. Click on the individual test to see the result. Theories are reported as individual cases, rather as a single unit. In NUnit, tests have names, which are not necessarily unique. Visual Studio wants the names to be unique. So if two tests have the same name, VS displays a warning message in the output window. The message may be ignored. Two separate results will be shown under the single test in the explorer pane. Startup performance is substantially improved but is still slower than using NUnit directly. Applies to pre-VS2017: When using a VSIX adapter and the NuGet adapter, the VSIX adapter will be used regardless of the NuGet adapter version. Workaround: Make sure you have upgraded VSIX adapter to latest version, or uninstalled it if you have the NuGet adapter in a solution. The adapter will display its version number in the Output window under Tests. Avoid using the VSIX adapter for VS2017 and upwards. It is being deprecated, but is still supported optionally in VS2019. Visual Studio 2017 Live Unit Testing require NUnit3. The NUnit2 adapter doesn't support Live Unit Testing. Exception: Could not load file or assembly 'nunit.engine' - Is caused by an incomplete copy of the adapter in the Visual Studio cache. Close Visual Studio and delete C:\\Users\\username\\AppData\\Local\\Temp\\VisualStudioTestExplorerExtensions\\NUnit3TestAdapter.{{version}} Issues with other tools Versions of ReSharper earlier than the 8.2 version has an issue with the NuGet adapter, which will prevent NUnit tests from running. Make sure you have updated Reshaper to at least version 8.2. ReSharper version 2018.1 are not able to work with adapter versions >= 3.12. This is fixed in 2018.3. See Issue638 for details."
},
"articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.html": {
"href": "articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.html",
"title": "NUnit and Microsoft Test Platform | NUnit Docs",
"keywords": "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 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: <EnableNUnitRunner>true</EnableNUnitRunner> <OutputType>Exe</OutputType> 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 NUnit Samples Adapter issue for implementing MTP 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. 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."
},
"articles/vs-test-adapter/Resources.html": {
"href": "articles/vs-test-adapter/Resources.html",
"title": "Resources | NUnit Docs",
Expand Down
10 changes: 10 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7325,6 +7325,16 @@
},
"version": ""
},
{
"type": "Conceptual",
"source_relative_path": "articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md",
"output": {
".html": {
"relative_path": "articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.html"
}
},
"version": ""
},
{
"type": "Conceptual",
"source_relative_path": "articles/vs-test-adapter/Resources.md",
Expand Down
Loading

0 comments on commit e3c9fdb

Please sign in to comment.