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. python抓取汇率

    # -*- coding: utf-8 -*- """ 获取实时汇率 Created on Fri Oct 18 13:11:40 2013 @author: alala ...

  2. PE文件信息获取工具-PEINFO

    能实现基本的信息获取 区段信息 数据目录信息 导入表函数分析 导出表函数分析,能同时解析只序号导出和以函数名序号同时导出的函数 FLC计算 需要源码的可以留邮箱.

  3. CSL概述(翻译总结自TI官方文档)

    一.简单介绍 CSL是函数,宏和符号常数的集合,用来控制和配置片上外设.(Chip Support Library) 每一个外设都有自己对应的CSL模块.每个模块有自己的支持符,来表示对于给定的设备, ...

  4. JavaScript 文件上传类型判断

    文件上传时用到一个功能,使用html元素的input标签实现, <input id="imageFile" name="imageFile1" accep ...

  5. 下拉菜单得经典写法html5

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  6. Java 延时常见的几种方法

    1. 用Thread就不会iu无法终止 new Thread(new Runnable() { public void run() { while (true) { test(); try { Thr ...

  7. HDU Destroy Transportation system(有上下界的可行流)

    前几天正看着网络流,也正研究着一个有上下界的网络流的问题,查看了很多博客,觉得下面这篇概括的还是相当精确的: http://blog.csdn.net/leolin_/article/details/ ...

  8. HDU 1385 Minimum Transport Cost (Dijstra 最短路)

    Minimum Transport Cost http://acm.hdu.edu.cn/showproblem.php?pid=1385 Problem Description These are ...

  9. **apache环境下 禁止显示 index of/ 目录下(如何禁止访问网站根目录)

    比如: http://123.57.49.XX6// 当这样访问的时候,可能会列出网站的根目录 如何禁止列出网站目录,方法如下: 让别人知道你的网站目录结构直接查看你目录下的所有文件是很危险的一个事情 ...

  10. hdu 2999 Stone Game, Why are you always there? 博弈论

    SG函数应用!! 代码如下: #include<cstdio> #include<cstring> #include<iostream> #include<c ...