Create a unit test project
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:
On the File menu, choose New and then choose Project (Keyboard Ctrl + Shift + N).
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.
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.
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:
Select the project in Solution Explorer.
On the Project menu, choose Add Reference....
In the Reference Manager dialog box, open the Solution node and choose Projects. Check the code project name and close the dialog box.
If the code that you want to test is in another location, see Managing references in a project for information about adding references.
Next steps
Writing unit tests
See one of the following sections:
Writing Unit Tests for the .NET Framework with the Microsoft Unit Test Framework for Managed Code
Writing Unit tests for C/C++ with the Microsoft Unit Testing Framework for C++
Running unit tests
Create a unit test project的更多相关文章
- How to Create a SharePoint 2010 Project Without SharePoint Server
转:http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2012/06/21/create-a-sharepoint- ...
- Visual Studio 2013 Unit Test Project App.config文件设置方法
开放中经常会要做单元测试,新的项目又没有单元测试项目,怎么才能搭建一个单元测试项目呢? 下面跟我四步走,如有错误之处,还请指正! 1.添加项目 2.添加配置文件 新建app.config文件,注意不是 ...
- 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 ...
- 1.【使用EF Code-First方式和Fluent API来探讨EF中的关系】
原文链接:http://www.c-sharpcorner.com/UploadFile/3d39b4/relationship-in-entity-framework-using-code-firs ...
- Testing with a mocking framework (EF6 onwards)
When writing tests for your application it is often desirable to avoid hitting the database. Entity ...
- 深入理解模型,视图和控制器(C#)
这篇文章向你提供ASP.NET MVC 模型,视图和控制的高度概览.换句话说,解释一下ASP.NET MVC中的 ‘M’, ‘V’, 和 ‘C’. 看完这篇文章以后,你应该就能理解ASP.NET MV ...
- [转]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 ...
- Understanding Models, Views, and Controllers (C#)
https://docs.microsoft.com/en-us/aspnet/mvc/overview/older-versions-1/overview/understanding-models- ...
- 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 ...
随机推荐
- poj 1113 Wall
题目链接:http://poj.org/problem?id=1113 题目大意:给出点集和一个长度L,要求用最短长度的围墙把所有点集围住,并且围墙每一处距离所有点的距离最少为L,求围墙的长度. 解法 ...
- BZOJ1500 维修数列
AC通道:http://www.lydsy.com/JudgeOnline/problem.php?id=1500 [前言] 据说没打这题就相当于没打过Splay,这题简直就是让你内心崩溃的... 这 ...
- Leetcode#137 Single Number II
原题地址 遍历所有数字,统计每一位出现的次数,模3即为只出现一次的数字在那一位的情况. 代码: int singleNumber(int A[], int n) { ] = {}; ; i < ...
- 用boost共享内存实现进程通信的例子
发送端 #include "DBProc1.h" #include <string> #include <thread> #include <boos ...
- VS开发工具 不会在异常的地方停止的问题.
启用"仅我的代码"
- tomcat 一个服务 多端口网站
多站点多端口 <Service name="Catalina"> <Connector port="8080" protocol ...
- SQL Server中存储过程 比 直接运行SQL语句慢的原因
问题是存储过程的Parameter sniffing 在很多的资料中都描述说SQLSERVER的存储过程较普通的SQL语句有以下优点: 1. 存储过程只在创造时进行编译即可,以后每次执行存储过 ...
- codeforces 442C C. Artem and Array(有深度的模拟)
题目 感谢JLGG的指导! 思路: //把数据转换成一条折线,发现有凸有凹 //有凹点,去掉并加上两边的最小值//无凹点,直接加上前(n-2)个的和(升序)//数据太大,要64位//判断凹与否,若一边 ...
- iOS第三方推送-极光推送
@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...
- React.js 样式组件:React Style
点这里 React Style 是 React.js 可维护的样式组件.使用 React Native StyleSheet.create一样的样式. 完全使用 JavaScript 定义样式: ? ...