You can include TestLeft test code in unit tests and run them by using various unit testing frameworks. This topic describes how to run TestLeft tests with NUnit:
About
(The adapter on the marketplace is the vsix adapter, which can be installed into VS itself - but this practice is not recommended and as you points out, doesn't even seem to work for Mac Community. If the user wishes to use the NUnit framework, they will need to navigate to the Extensions and Updates window within Visual Studio. Once in here you will want to select the online option and use the search bar to look for “NUnit” and then install the “NUnit 2 Test Adapter” It is important to note that we do not currently support.
NUnit is a unit testing framework for .NET applications. TestLeft provides an NUnit project template for Visual Studio that simplifies creation of NUnit tests that run TestLeft code. You will be able to run such tests by using the NUnit utility or from Visual Studio by using NUnit Test Adapter.
Requirements
- You need to have NUnit version 3.2 installed. To learn how to install it, see the Installation section of the NUnit documentation.
- To run TestLeft tests from Visual Studio by using NUnit Test Adapter, you must have the NUnit 3 Test Adapter extension installed in your Visual Studio. To learn how to install the adapter, see the Adapter Installation section in the NUnit documentation.
- The NUnit project and test templates are available only for Visual Studio projects that target .NET Framework version 4.5 or higher.
Note: | If you use an earlier version on NUnit or if you use another unit testing framework, you can add TestLeft code to your unit tests and run them by using your framework manually, without using the templates. |
Creating and Running a TestLeft Test
- Add a TestLeft NUnit Test Project to your solution:
- In Visual Studio’s Solution Explorer, right-click the solution and then click Add New Project.
- In the Add New Project dialog, select the Test category and then select the TestLeft NUnit Project type.
- Click OK to add a project.
- Visual Studio will add a TestLeft NUnit Project to your solution.
- In the created project, add a reference to the nunit.framework.dll library:By using NuGetBy using NuGet
- In Solution Explorer, select your NUnit TestLeft project.
- Right-click the project and then click Manage NuGet Packages.
- In the resulting dialog, find the NUnit package (version 3.2).
- Click Install.
You can find more information on installing NUnit modules in the NUnit documentation (available at https://github.com/nunit/docs/wiki/Installation).ManuallyManuallyRequirement: You will need a NUnit framework installed on your computer.- In Solution Explorer, select your NUnit TestLeft project.
- Right-click the References item and then click Add Reference.— or --Select Project | Add Reference from Visual Studio’s main menu.
- In the Reference Manager, click Browse.
- Browser for nunit.framework.dll on your computer and click Add.
- Select the check box next to the nunit.framework.dll library and click OK.
- The NUnit TestLeft project includes a reference to the SmartBear.TestLeft.dll library.The project also defines a
TestFixtureBase
class. The class specifies methods to call before, after and when running a test. Use the class to create tests.Note: The project defines a sample test - HelloWorldTest. You can delete it if you do not need it or use it as a base to create your own tests. - Write your test code. To learn how to create test instructions, see 2. Write Test Code.
- Build the project.
- Run the test:By using NUnit Test AdapterBy using NUnit Test Adapter
- If you do not have NUnit 3 Test Adapter in your Visual Studio, install it. You can find detailed instructions on installing the adapter in the NUnit documentation (available at https://github.com/nunit/docs/wiki/Adapter-Installation).You may need to restart Visual Studio after the installation and rebuild your test project.
- In Visual Studio, open the Test Explorer panel.
- In the panel, select the needed test and run it.
From the command lineFrom the command lineYou can use the NUnit console utility (nunit-console.exe) to run created tests. For information on command-line arguments, see the NUnit documentation (https://github.com/nunit/docs/wiki/Console-Runner). - After the test run is over, Visual Studio will automatically save the test results to the folder where the test assembly resides. It will store the test results in the unpacked HTML format. Open the index.htm file to view the test log.
See Also
Cached
Running TestLeft Tests From Unit Testing Frameworks
Using TestLeft
Writing Test Code
Using TestLeft
Writing Test Code
A package including the NUnit 3 TestAdapter for Visual Studio 2012 onwards. With this package you don't need to install the VSIX adapter package, and you don't need to upload the adapter to your TFS server.
Note that this package ONLY contains the adapter, not the NUnit framework. You must also get the framework. You only need one such package for a solution.
The package works with Visual Studio 2012 and newer.
Note that this package ONLY contains the adapter, not the NUnit framework. You must also get the framework. You only need one such package for a solution.
The package works with Visual Studio 2012 and newer.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
For projects that support PackageReference, copy this XML node into the project file to reference the package.
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Release Notes
Visual Studio Community For Mac How To Install Nunit Test Adapter
This release works with NUnit 3.0 and higher only.
Dependencies
.NETCoreApp 1.0
- Microsoft.DotNet.InternalAbstractions(>= 1.0.0)
- System.ComponentModel.EventBasedAsync(>= 4.3.0)
- System.ComponentModel.TypeConverter(>= 4.3.0)
- System.Diagnostics.Process(>= 4.3.0)
- System.Reflection(>= 4.3.0)
- System.Runtime.InteropServices.RuntimeInformation(>= 4.3.0)
- System.Threading.Thread(>= 4.3.0)
- System.Xml.XmlDocument(>= 4.3.0)
- System.Xml.XPath.XmlDocument(>= 4.3.0)
Used By
![Mac Mac](/uploads/1/1/8/9/118984299/784305847.png)
NuGet packages (125)
Showing the top 5 NuGet packages that depend on NUnit3TestAdapter:
Package | Downloads |
---|---|
SpecFlow.NUnit.Runners Combined package to setup SpecFlow with NUnit easily for running the tests with the NUnit runners. | |
Objectivity.Test.Automation.Common.NUnit [DEPRECATED]UseInstall-Package Ocaramba.Features Install-Package Ocaramba.MsTestInstall-Package Ocaramba.NUnit Install-Package Ocaramba.xUnit instead | |
SpecsFor.Core SpecsFor is another Behavior-Driven Development framework that focuses on ease of use for *developers* by minimizing testing friction. | |
Atrico.Lib.Testing | |
Objectivity.Test.Automation.Common.Features [DEPRECATED]UseInstall-Package Ocaramba.Features Install-Package Ocaramba.MsTestInstall-Package Ocaramba.NUnit Install-Package Ocaramba.xUnit instead |
GitHub repositories (515)
Showing the top 5 popular GitHub repositories that depend on NUnit3TestAdapter:
Repository | Stars |
---|---|
Wox-launcher/Wox Launcher for Windows, an alternative to Alfred and Launchy. | |
icsharpcode/ILSpy .NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform! | |
OpenRA/OpenRA Open Source real-time strategy game engine for early Westwood games such as Command & Conquer: Red Alert written in C# using SDL and OpenGL. Runs on Windows, Linux, *BSD and Mac OS X. | |
JamesNK/Newtonsoft.Json Json.NET is a popular high-performance JSON framework for .NET | |
restsharp/RestSharp |
Version History
Version | Downloads | Last updated |
---|---|---|
4.0.0-beta.1 | 5,196 | 11/20/2020 |
4.0.0-alpha.1 | 40,813 | 7/12/2020 |
3.17.0 | 2,823,102 | 7/11/2020 |
3.17.0-beta.2 | 10,173 | 6/25/2020 |
3.17.0-beta.1 | 72,420 | 4/19/2020 |
3.16.1 | 7,264,247 | 1/18/2020 |
3.16.0 | 661,517 | 1/3/2020 |
3.15.1 | 8,221,519 | 8/30/2019 |
3.15.0 | 345,415 | 8/23/2019 |
3.14.0 | 667,415 | 8/8/2019 |
3.13.0 | 8,089,922 | 2/21/2019 |
3.12.0 | 2,709,052 | 12/19/2018 |
3.11.2 | 1,227,752 | 11/22/2018 |
3.11.1 | 163,356 | 11/21/2018 |
3.11.0 | 3,518,695 | 10/28/2018 |
3.10.0 | 8,385,414 | 3/8/2018 |
3.9.0 | 3,336,133 | 10/30/2017 |
3.8.0 | 1,993,189 | 7/19/2017 |
3.8.0-alpha1 | 197,493 | 5/4/2017 |
3.7.0 | 1,522,031 | 1/26/2017 |
3.6.0 | 477,190 | 11/15/2016 |
3.5.1 | 75,247 | 10/28/2016 |
3.5.0 | 140,372 | 10/23/2016 |
3.4.1 | 402,714 | 8/5/2016 |
3.4.0 | 101,529 | 7/3/2016 |
3.2.0 | 68,764 | 6/4/2016 |
3.0.10 | 85,354 | 4/19/2016 |
3.0.9-ctp-9 | 10,360 | 4/3/2016 |
3.0.8-ctp-8 | 155,829 | 12/2/2015 |
3.0.7-ctp-7b | 4,888 | 11/17/2015 |
3.0.7-ctp-7 | 1,114 | 11/16/2015 |
3.0.6-ctp-6 | 1,402 | 11/11/2015 |
3.0.5-ctp-5 | 891 | 11/10/2015 |
3.0.4-ctp-4 | 5,137 | 7/21/2015 |
3.0.2-ctp-3 | 1,846 | 5/22/2015 |