Part I.: Installation of Visual Studio 2015
My Computer system is WIN10, so the installation is Visual Studio 2015, the installation Steps section:
1. Installation type options interface: You can choose the default installation, you can choose a custom installation, but in my several attempts, the default installation sometimes some C + + required components to download separately, it is best to choose a custom installation, one-time all required components all installed all.
2. The following is the installation process:
3. The following is the installation complete, open the interface:
Part II: Unit Test Exercises
1. First open vs2015, select Create a new project, as follows:
2. Select and create a class library in C # in the new project, named DemoUser, as follows:
3. After clicking OK, enter the code in the Code compilation area,
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Text;
Using System.Threading.Tasks;
Namespace DemoUser
{
public class User
{
Public User (String useremail)
{
M_email = UserEmail;
}
private string M_email;
}
}
:
4. Mouse point in the user class construction method, right click, select Create Unit test, as follows:
5. Create a Test unit project with the following results:
6. At this point in the Solution Explorer on the right, you will find a new project that is demousertests, the left side will appear a space named Demouser.tests, Inside [Testmethod ()] This statement,:
7. Make a replication in the Usertest function below the [Testmethod ()] statement:
8. With the mouse selected Usertest function, right click, select Run Test:
9. Test run success, results:
The above is the installation of vs2015, and unit test exercises, at the beginning did not find how to run the test, later on the Internet to check the information, in the function right click can open.
Installation and unit testing exercises for Visual Studio 2015