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. 【BZOJ】【1046】/【POJ】【3613】【USACO 2007 Nov】Cow Relays 奶牛接力跑

    倍增+Floyd 题解:http://www.cnblogs.com/lmnx/archive/2012/05/03/2481217.html 神题啊= =Floyd真是博大精深…… 题目大意为求S到 ...

  2. Leetcode#174 Dungeon Game

    原题地址 典型的地图寻路问题 如何计算当前位置最少需要多少体力呢?无非就是在向下走或向右走两个方案里做出选择罢了. 如果向下走,看看当前位置能提供多少体力(如果是恶魔就是负数,如果是草药就是正数),如 ...

  3. nodeJs 初探 ~

    今天晚上,开始时间了一下nodejs,跟着 Node入门 一步步的往下走.对node开发也有了初步的了解. 期间没有碰到什么问题,只有在最后的时候,碰到了几个问题.在这里记录一下: 1 . cross ...

  4. C#中实现VB中的CreateObject方法

    经常看到有些VB的例子中直接用个CreateObject就可调用系统功能(大多是COM对象),像用户设定,网络设定等等.虽然C#中可以通过使用VB的命名空间的方法来调用CreateObject函数,但 ...

  5. Spring声明式事务配置管理方法(转)

    项目使用SSH架构,现在要添加Spring事务管理功能,针对当前环境,只需要添加Spring 2.0 AOP类库即可.添加方法: 点击项目右键->Build Path->Add libra ...

  6. codechef 两题

    前面做了这场比赛,感觉题目不错,放上来. A题目:对于数组A[],求A[U]&A[V]的最大值,因为数据弱,很多人直接排序再俩俩比较就过了. 其实这道题类似百度之星资格赛第三题XOR SUM, ...

  7. AC 自动机在这里

    HDU 3065,模板(备忘录) #include<stdio.h> #include<string.h> #include<math.h> #include< ...

  8. 关于linux系统如何实现fork的研究(二)

    本文为原创,转载请注明:http://www.cnblogs.com/tolimit/ 引言 前一篇关于linux系统如何实现fork的研究(一)通过代码已经说明了从用户态怎么通过软中断实现调用系统调 ...

  9. 如何使用 Docker 部署一个基于 Play Framework 的 Scala Web 应用?

    本文作者 Jacek Laskowski 拥有近20年的应用程序开发经验,现 CodiLime 的软件开发团队 Leader,曾从 IBM 取得多种资格认证.在这篇博文中,Jacek 分享了 Wars ...

  10. 如何说服你的老板必须使用APM?

    APM研究院 2015/04/24 16:56 2013年,某权威机构提供一组数据显示:亚马逊每100毫秒延迟会使销售额下降1%:雅虎一秒钟服务器延迟导致收入下降2.8%:谷歌搜索结果页面放缓100毫 ...