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.
- or download NUnit's NuGet package first, and download the method to see the article I described earlier.
- 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