{"id":20603863,"url":"https://github.com/nunit/nunit-vs-templates","last_synced_at":"2025-03-06T16:45:11.611Z","repository":{"id":46198327,"uuid":"43159306","full_name":"nunit/nunit-vs-templates","owner":"nunit","description":"Visual Studio project \u0026 item templates and snippets","archived":false,"fork":false,"pushed_at":"2022-03-30T17:27:21.000Z","size":16735,"stargazers_count":33,"open_issues_count":9,"forks_count":15,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-10-24T17:53:52.963Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://visualstudiogallery.msdn.microsoft.com/6cd55f79-4936-49e7-b81d-c40fcd81abc7","language":"Vim Snippet","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nunit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-25T16:18:24.000Z","updated_at":"2024-01-15T03:52:47.000Z","dependencies_parsed_at":"2022-09-23T05:51:18.969Z","dependency_job_id":null,"html_url":"https://github.com/nunit/nunit-vs-templates","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nunit%2Fnunit-vs-templates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nunit%2Fnunit-vs-templates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nunit%2Fnunit-vs-templates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nunit%2Fnunit-vs-templates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nunit","download_url":"https://codeload.github.com/nunit/nunit-vs-templates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241758818,"owners_count":20015240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T09:19:02.823Z","updated_at":"2025-03-06T16:45:11.605Z","avatar_url":"https://github.com/nunit.png","language":"Vim Snippet","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NUnit Visual Studio Templates\n\n**This project has been archived.**  \n\n**This is a VSIX project, which we don't support anymore.  Use `dotnet new nunit` instead, or install using Visual Studio - New Project dialog, selecting NUnit.**\n\n---------\n\n[![Build status](https://ci.appveyor.com/api/projects/status/lx7icpyp4g0m0223/branch/master?svg=true)](https://ci.appveyor.com/project/CharliePoole/nunit-templates/branch/master)\n\nAn extension that adds Project and Item templates to Visual Studio\nalong with Code Snippets to make unit testing with NUnit 3 easier. \nWe currently only plan to add templates for NUnit 3, but will add \ntemplates for NUnit 2.6.4 if there is demand.\n\nThis project is build using [SideWaffle](http://sidewaffle.com/), many\nthanks for their great work.\n\n## Download\n\nYou can download the extension for Visual Studio 2012-2019 from the [Visual Studio Gallery](https://visualstudiogallery.msdn.microsoft.com/6cd55f79-4936-49e7-b81d-c40fcd81abc7)\nor from the [GitHub Releases](https://github.com/nunit/nunit-vs-templates/releases) page.\n\n## Content\n\nThe project currently provides the following templates.\n\n### Project Templates\n\n| Template                     | Platform                     | Language     | Project Type         |\n|------------------------------|------------------------------|--------------|----------------------|\n| NUnit 3 Unit Test Project    | Desktop                      | C#           | Traditional Style \u003csup\u003e3\u003c/sup\u003e |\n| NUnit 3 Unit Test Project    | Desktop                      | C#           | Sdk Style            | \n| NUnit 3 Unit Test Project    | Desktop .NET Core            | C#           | SDK Style            | \n| NUnit 3 Unit Test Project    | Desktop                      | Visual Basic | Traditional Style \u003csup\u003e3\u003c/sup\u003e |\n| NUnit 3 Unit Test Project    | Xamarin Android \u003csup\u003e1\u003c/sup\u003e | C#           | Traditional Style    |\n| NUnit 3 Unit Test Project    | Xamarin iOS \u003csup\u003e1\u003c/sup\u003e     | C#           | Traditional Style    |\n| NUnit 3 Unit Test Project    | Xamarin UWP \u003csup\u003e1,2\u003c/sup\u003e   | C#           | Traditional Style    |\n\n1. Requires [Xamarin for Visual Studio](https://xamarin.com/visual-studio) be installed.\n2. Requires the [Windows 10 SDK](https://dev.windows.com/en-us/downloads/windows-10-sdk) be installed.\n3. Legacy csproj format \n\n### Item Templates\n\n| Template             | Language      | Description |\n|----------------------|---------------|-------------|\n| NUnit Test Fixture   | C#            | An NUnit unit test class |\n| NUnit Test Fixture   | Visual Basic  | An NUnit unit test class |\n| NUnit SetUp Fixture  | C#            | Code that runs before and after all the tests in the assembly |\n| NUnit SetUp Fixture  | Visual Basic  | Code that runs before and after all the tests in the assembly |\n\n### Code Snippets\n\n| Snippet         | Shortcut     | Language      | Comment |\n|-----------------|--------------|---------------|---------|\n| Test Fixture    | ntestfixture | C#            | |\n| Test Method     | ntest        | C#            | |\n| Test Case       | ntestcase    | C#            | |\n| Test Case Source | ntestcasesource     | C#  | Form 1 |\n| Test Case Source | ntestcasesource2    | C#  | Form 2 |\n| Test Case Source | ntestcasesource3    | C#  | Form 3 |\n| Test Case Source | ntestcasesource4    | C#  | Form 3 with testdata|\n| Assert.Multiple | nmultiple | C# | Surround snippet |\n\nNote:  \"Form\": Refer to [documentation for details](https://github.com/nunit/docs/wiki/TestCaseSource-Attribute)\n\n## Contributing\n\nDon't see the template you need or your favorite code snippet? All you need\nto do is fork the repository, add it and create a pull request. We love help\nand contributions.\n\nFor information on how to add templates and snippets, head over to the\n[SideWaffle Documentation](https://github.com/ligershark/side-waffle/wiki).\n\nThere is also a great walkthrough on creating templates in the \n[June 2015 MSDN Magazine](https://msdn.microsoft.com/en-us/magazine/mt147242.aspx).\n\n### Prerequisites\n\nWe highly recommend that you use the following extensions for Visual Studio when\nworking on this project.\n\n- [SideWaffle](http://sidewaffle.com/) (Not needed, now included as nuget package) - Adds the \ntemplates and functionality you will need to work on this project.\n- [Snippet Designer](https://github.com/mmanela/SnippetDesigner) - Provides a\nfriendly UI for editing code snippets.\n- [EditorConfig](http://editorconfig.org/) - Configures tabs and spaces to the \nproject defaults.\n- [Rebracer](https://github.com/SLaks/Rebracer) - Configures code formating to \nthe NUnit project defaults in Visual Studio.\n\n### Adding Project Templates\n\n- Add a new project that will serve as your template\n- Modify the project to ensure it builds and produces the correct output\n- Right click on the nunit.templates project and select **Add | Add Template Reference (SideWaffle project)**.\n- Select your project from the dropdown and add it.\n- Your project will have two new files added, `_Definitions\\_project.vstemplate.xml` and `_preprocess.xml`.\n- Edit both of these files using those from other projects as a reference.\n- Delete **sw-file-icon.png** from your project.\n- Copy **nunit.png** from **nunit-tests.csharp** into your project directory, but don't add it to your project.\n- Remove packages.config and edit the project file to remove all of your NuGet references.\n- Add NuGet packages to your *vstemplate* file. See the other *vstemplate* files and [NuGet docs](http://docs.nuget.org/Create/Packages-in-Visual-Studio-Templates) for more information.\n- If the NuGet package isn't already in the `nunit.templates\\Packages` directory, you will have to add it, set it as *Include in VSIX* and add it to the *vsixmanifest* file.\n- Test your project template by compiling and running the project. This will open an experimental\ninstance of Visual Studio with the extension installed for testing.\n- Once you are happy with your project, **remove it from all build configurations**.- Add your project template to README.md\n- Push your branch to GitHub and create a Pull Request\n\n### Adding Item Templates\n\n- Right-click on the *ItemTemplates\\Test* folder in the **nunit.templates** project, **Add | New Item...** and add a **SideWaffle Item Template**. Don't worry about the name, it is not used\n- This will create a *CSharp* folder, rename it for your template \n- Add your source file into your new folder and set the **Build Action** in properties to **Content**\n- Replace your namespace with *$rootnamespace$* and your class name with *$safeitemname$*\n- Four vstemplate files were created in a *Definitions* sub-folder. Delete any for languages your template does not support and then rename the remaining from **.vstemplat-* to **.vstemplate*\n- Fill in the *vstemplate* files using existing templates as a reference\n- Delete the *readme.txt* file and overwrite *icon.png* with an existing NUnit icon from another template.\n- Test your item template by compiling and running the project. This will open an experimental\ninstance of Visual Studio with the extension installed for testing.\n- Add your item template to README.md\n- Push your branch to GitHub and create a Pull Request\n\n### Adding Code Snippets\n\n- In the language specific Snippets folder of the **nunit.templates** project,\nright click on the **Test** folder and **Add | New item...***\n- Search for snippet and add a new **Code Snippet**\n- Make sure the build type for your new snippet is set to **Content** in the properties\n- Edit your snippet making sure to give it a unique shortcut. We are currently starting\nall NUnit snippets with the letter n\n- Test your snippet by compiling and running the project. This will open an experimental\ninstance of Visual Studio with the extension installed for testing.\n- Add your snippet to README.md\n- Push your branch to GitHub and create a Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnunit%2Fnunit-vs-templates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnunit%2Fnunit-vs-templates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnunit%2Fnunit-vs-templates/lists"}