C # Create a unit Test "graphic Tutorial"

Source: Internet
Author: User
To create a unit test in VS2012

1 Open Tools-Custom

2 Select context Menu--Editor Context menu | code window

3 Here we can see the "Create Unit Test" menu, move it under the Run Test menu

4 off vs and restart
After restarting the class name and clicking the right button, the "Create Unit Test" button appears in the context menu, but it is grayed out and cannot be used. But we are not far from success.
Rebooting is important, and if you don't reboot, the menu doesn't come out.

5 in the solution, add--New project, add a unit test project.

As shown in figure:

6 Right-key unit test project, Add--Unit test

Haha, this time is done, you return to the non-test project project, right click on the class name, you can see the "Create Unit Test" can be used.

PS: As if the project was reopened, the "Create unit Test" would be grayed out, but it would be OK to perform step 6 again.

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.