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 ...
随机推荐
- window.showModalDialog的传值和返回值
window.showModalDialog(URL,dialogArgments,features) 打开一个新窗口 URL为要将打开的网页地址. dialogArgments为设定好传递给新视窗网 ...
- Win8必知快捷键汇总
* Win+C:调出应用Charm菜单(开始界面.传统桌面) * Win+D:所有程序最小化,再次按下恢复(开始界面.传统桌面) * Win+E:打开我的电脑(开始界面.传统桌面) * Win+F:调 ...
- 就地交叉数组元素[a1a2b1b2]->[a1b1a2b2]
问题描述: If [a1,a2,a3...,an,b1,b2...bn] is given input change this to [a1,b1,a2,b2.....an,bn] , solutio ...
- POJ 3185
The Water Bowls Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 4088 Accepted: 1609 D ...
- POJ 1488
#include <iostream> #include <string> using namespace std; int main() { string s; int i; ...
- AsyncTask和Handler对比
AsyncTask和Handler对比 1 ) AsyncTask实现的原理,和适用的优缺点 AsyncTask,是android提供的轻量级的异步类,可以直接继承AsyncTask,在类中实现异步操 ...
- [LeetNode]Sort List
Sort a linked list in O(n log n) time using constant space complexity. 思路:分治+递归. /** * Definition fo ...
- sizeof学习理解
以下内容转自: http://www.cnblogs.com/ComputerG/archive/2012/02/02/2335611.html 博问 闪存 首页 新随笔 联系 管理 随笔- 72 ...
- Linux网络编程5——使用UDP协议实现群聊
引言 本文实现的功能类似于我之前所写的一篇博文(Linux之select系统调用_2),区别在于进程之间的通信方式有所不同.之前的文章中,我所使用的是管道,而本文我将会使用socket接口. 需求 客 ...
- 编程实现linux下的shell
/************************************************************************* > File Name: Kris_shel ...