Installation and unit testing exercises for Visual Studio 2015

Source: Internet
Author: User

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

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.