Test-driven development using NUnit under Visual Studio

Source: Internet
Author: User

The MSTest integrated in Visual Studio 2015 can be used for unit testing.

In the project, select the method you want to test, right-click, select "Create Unit Test" in the pop-up menu, and follow the default settings to create a new test project automatically.

It is important to note that only the Puglic method can be tested.

However, I still prefer the NUnit test framework, after all, from JUnit to NUnit, the use of the familiar taste is better. Here's how to integrate the NUnit test framework in VS2015.

  1. or download NUnit's NuGet package first, and download the method to see the article I described earlier.
  2. Install the NUnit Test Generator extension And if you cannot install it online, you can do so in https://visualstudiogallery.msdn.microsoft.com/ BD30BF3F-4183-4B00-A245-1875316B8CD3 page download.

Once the installation is complete, we create a new unit test and see that we can use the NUnit test framework for unit testing.

Is it still very simple??, of course, with a good unit test, the mock tool is essential, and the next step is MOQ!

Test-driven development using NUnit under Visual Studio

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.