• Categories

  • Nunit Code Snippet

    Here is a useful code snippet that I use all the time to create an empty unit test.

    To use it go to your My Code Snippets folder, go to the snippet manager in Visual Studio (Ctrl K + Ctrl B) to get the file path if you don’t know it. Create a new text file with and appropriate name and rename the extension to .snippet and cut and paste the following xml into the file and save it.


    <?xml version="1.0" encoding="utf-8"?>
    <CodeSnippets xmlns="">
        <CodeSnippet Format="1.0.0">
                    NUnit Test
                        <ToolTip>Replace with test method name</ToolTip>
                <Code Language="CSharp">
                public void $Test_Name$()
    And Bob’s your uncle it should appear in your code snippet shortcuts..Ctrl K Ctrl S to access.

    Tags: , , ,

    Leave a Reply