https://msdn.microsoft.com/en-us/library/hh598957.aspx

Unit tests often mirror the structure of the code under test.

For example, a unit test project would be created for each code project in the product.

The test project can be in the same solution as the production code, or it can be in a separate solution.

You can have multiple unit test projects in a solution.

To create a unit test project:

  1. On the File menu, choose New and then choose Project (Keyboard Ctrl + Shift + N).

  2. In the New Project dialog box, expand the Installed node, choose the language that you want to use for your test project, and then chooseTest.

  3. To use one of the Microsoft unit test frameworks, choose Unit Test Project from the list of project templates. Otherwise, choose the project template of the unit test framework that you want to use. To test the Accounts project of our example, you would name the project AccountsTests.

  4. In your unit test project, add a reference to the code under test. Here’s how to create the reference to a code project in the same solution:

    1. Select the project in Solution Explorer.

    2. On the Project menu, choose Add Reference....

    3. In the Reference Manager dialog box, open the Solution node and choose Projects. Check the code project name and close the dialog box.

  5. If the code that you want to test is in another location, see Managing references in a project for information about adding references.

新建一个单元测试项目,并把待测试的项目作为引用添加 
 

Create a unit test project的更多相关文章

  1. How to Create a SharePoint 2010 Project Without SharePoint Server

    转:http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2012/06/21/create-a-sharepoint- ...

  2. Visual Studio 2013 Unit Test Project App.config文件设置方法

    开放中经常会要做单元测试,新的项目又没有单元测试项目,怎么才能搭建一个单元测试项目呢? 下面跟我四步走,如有错误之处,还请指正! 1.添加项目 2.添加配置文件 新建app.config文件,注意不是 ...

  3. create a cocos2d-x-3.0 project in Xcode

    STEP1: Open Terminal SETP2: Run setup.py SETP3: Run source /Users/your_user/.bash_profile( so that e ...

  4. 1.【使用EF Code-First方式和Fluent API来探讨EF中的关系】

    原文链接:http://www.c-sharpcorner.com/UploadFile/3d39b4/relationship-in-entity-framework-using-code-firs ...

  5. Testing with a mocking framework (EF6 onwards)

    When writing tests for your application it is often desirable to avoid hitting the database.  Entity ...

  6. 深入理解模型,视图和控制器(C#)

    这篇文章向你提供ASP.NET MVC 模型,视图和控制的高度概览.换句话说,解释一下ASP.NET MVC中的 ‘M’, ‘V’, 和 ‘C’. 看完这篇文章以后,你应该就能理解ASP.NET MV ...

  7. [转]Creating an Entity Framework Data Model for an ASP.NET MVC Application (1 of 10)

    本文转自:http://www.asp.net/mvc/overview/older-versions/getting-started-with-ef-5-using-mvc-4/creating-a ...

  8. Understanding Models, Views, and Controllers (C#)

    https://docs.microsoft.com/en-us/aspnet/mvc/overview/older-versions-1/overview/understanding-models- ...

  9. create dll project based on the existing project

    Today, I have to create a dll project(called my.sln), the dllmain.cpp/.h/ is already in another proj ...

随机推荐

  1. Fiddler2汉化版使用说明

    fiddler是一款免费且功能强大的数据包抓取软件,它能够快速的抓取HTTP会话以及支持监视.还可设置断点等诸多实用功能,非常适合计算机工作者们分析数据使用.本文就为大家详细介绍一下fiddler的功 ...

  2. CountDownLatch,一个同步辅助类,在完成一组正在其他线程中执行的操作之前,它允许一个或多个线程一直等待。

    CountDownLatch,一个同步辅助类,在完成一组正在其他线程中执行的操作之前,它允许一个或多个线程一直等待. 主要方法 public CountDownLatch(int count); pu ...

  3. 解决Flash和html在多标签浏览器中互访问题

    在Flash播放器运行时,将不同来源的资源划分到独立的沙箱(sandbox)内,不同沙箱之间不能 彼此操作数据(除非目标沙箱做过一些设置,授权其他沙箱可访问),这就是Flash的跨沙箱问题.当Flas ...

  4. swappiness

    在ubuntu 里面,swappiness的值的大小对如何使用swap分区是有着很大的联系的.swappiness=0的时候表示最大限度使用物理内存,然后才是 swap空间,swappiness=10 ...

  5. Chapter 4 持久存储数据对象

    1.使用with open("filename.扩展名","r/w/rb/wb") as data代替data=open(..);data.close() 打开 ...

  6. 开源DBCP、C3P0、Proxool 、 BoneCP连接池的比较

    简介 项目主页 使用评价  DBCP DBCP是一个依赖Jakarta commons-pool对象池机制的数据库连接池.DBCP可以直接的在应用程序用使用 http://homepages.nild ...

  7. POJ 1279 Art Gallery(半平面交求多边形核的面积)

    题目链接 题意 : 求一个多边形的核的面积. 思路 : 半平面交求多边形的核,然后在求面积即可. #include <stdio.h> #include <string.h> ...

  8. 2014多校第一场 E 题 || HDU 4865 Peter's Hobby (DP)

    题目链接 题意 : 给你两个表格,第一个表格是三种天气下出现四种湿度的可能性.第二个表格是,昨天出现的三种天气下,今天出现三种天气的可能性.然后给你这几天的湿度,告诉你第一天出现三种天气的可能性,让你 ...

  9. poj 1678 I Love this Game!

    思路:这题和博弈论的关系不大,主要是DP.记忆化搜索即可!!! 取的数一定是大于0的,所以将负数去掉!! 代码如下: #include<iostream> #include<cstd ...

  10. 546B. Soldier and Badges

    题目链接 题意: n个数,要保证这n个数完全不相同,求需要把原来的数增加多少,求这个值得最小值   Java 程序 import java.io.PrintStream; import java.ut ...