In order to use NUnit with Visual Studio you do not need to install or configure NUnit into Visual Studio. You will simply load .DLLs or .EXEs into NUnit through it's GUI.
Before creating any projects add the NUnit Test Adapter to Visual Studio
- Select Tools/Extensions and Updates
- Select online
- Search for NUnit, download and install
Install NUnit onto your machine. When you create a project and want it to be used by NUnit, you must ensure that the libraries are available to your project.
- Select Project/Add Reference
- Select Extensions
- Search for nunit.Framework and nunit.Mocks
- if they are not available, select Browse... in the lower right of the open dialog
- navigate to the directory where you installed NUnit
- add the nunit.framework.dll to the list of extensions
- Add them to your project
Step-by-step guideguide
- Add the following using statement - using NUnit.Framework
- Add /[TestFixture] attribute to your class
- If you need to initialise objects that you want to reuse across multiple tests add a setup method, this is done by adding the [Setup] attribute
- For each operation that you need to indicate is a test method mark it with the [Test, Category("...")], Category is optional
Info |
---|
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...