Home

Awesome

NUnit Visual Studio Templates

Build status

An extension that adds Project and Item templates to Visual Studio along with Code Snippets to make unit testing with NUnit 3 easier. We currently only plan to add templates for NUnit 3, but will add templates for NUnit 2.6.4 if there is demand.

This project is build using SideWaffle, many thanks for their great work.

Download

You can download the extension for Visual Studio 2012-2019 from the Visual Studio Gallery or from the GitHub Releases page.

Content

The project currently provides the following templates.

Project Templates

TemplatePlatformLanguageProject Type
NUnit 3 Unit Test ProjectDesktopC#Traditional Style <sup>3</sup>
NUnit 3 Unit Test ProjectDesktopC#Sdk Style
NUnit 3 Unit Test ProjectDesktop .NET CoreC#SDK Style
NUnit 3 Unit Test ProjectDesktopVisual BasicTraditional Style <sup>3</sup>
NUnit 3 Unit Test ProjectXamarin Android <sup>1</sup>C#Traditional Style
NUnit 3 Unit Test ProjectXamarin iOS <sup>1</sup>C#Traditional Style
NUnit 3 Unit Test ProjectXamarin UWP <sup>1,2</sup>C#Traditional Style
  1. Requires Xamarin for Visual Studio be installed.
  2. Requires the Windows 10 SDK be installed.
  3. Legacy csproj format

Item Templates

TemplateLanguageDescription
NUnit Test FixtureC#An NUnit unit test class
NUnit Test FixtureVisual BasicAn NUnit unit test class
NUnit SetUp FixtureC#Code that runs before and after all the tests in the assembly
NUnit SetUp FixtureVisual BasicCode that runs before and after all the tests in the assembly

Code Snippets

SnippetShortcutLanguageComment
Test FixturentestfixtureC#
Test MethodntestC#
Test CasentestcaseC#
Test Case SourcentestcasesourceC#Form 1
Test Case Sourcentestcasesource2C#Form 2
Test Case Sourcentestcasesource3C#Form 3
Test Case Sourcentestcasesource4C#Form 3 with testdata
Assert.MultiplenmultipleC#Surround snippet

Note: "Form": Refer to documentation for details

Contributing

Don't see the template you need or your favorite code snippet? All you need to do is fork the repository, add it and create a pull request. We love help and contributions.

For information on how to add templates and snippets, head over to the SideWaffle Documentation.

There is also a great walkthrough on creating templates in the June 2015 MSDN Magazine.

Prerequisites

We highly recommend that you use the following extensions for Visual Studio when working on this project.

Adding Project Templates

Adding Item Templates

Adding Code Snippets