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 ...
随机推荐
- hdu 2426 Interesting Housing Problem 最大权匹配KM算法
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2426 For any school, it is hard to find a feasible ac ...
- 【BZOJ】【1052】【HAOI2007】覆盖问题
二分+贪心 首先二分L,转化成判定问题…… 但是判定不会判啊QAQ orz hzwer,用一个最小的矩形框住所有点后,直接往矩形的角上摆正方形……第二个用同样的方法摆,最后判一下剩下的能否被完全覆盖 ...
- 【BZOJ】【2756】【SCOI2012】奇怪的游戏
网络流-最大流 这题……建模部分先略过 这道题是会卡时限的T_T俺的Dinic被卡了,在此放几篇很棒的讲网络流算法的文章,至于大家耳熟能详的论文就不放了…… http://www.cppblog.co ...
- Oracle 显示时间问题
在部署的时候. 显示的时间为会 2014/1/1 9:00:00 pm 但开发过程中显示为正常: 2014-1-1 21:00:00 解决方法: 1. Oracle数据库的时间格式没有问题, ...
- HDU1005Number Sequence(找规律)
Number Sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)T ...
- sigaction 函数
本文主要参考<unix环境高级编程> sigaction函数的功能是检查或修改与指定信号相关联的处理动作(可同时两种操作). int sigaction(int signo,con ...
- css hack一览
浏览器对css hack的支持情况
- Asp.net MVC 实现图片上传剪切
使用技术:Asp.net MVC与jquery.uploadify,Jcrop 首先上页面 01 <strong><!DOCTYPE html> 02 <html> ...
- 几种基于HTTP协议的RPC性能比较
有了整体的了解后,可以发现Hessian的这个远程过程调用,完全使用动态代理来实现的,其实从客户端代码不难看出,HessianProxyFactory的create方法就是创建接口Basic的代理类, ...
- React Native 简介:用 JavaScript 搭建 iOS 应用 (1)
[编者按]本篇文章的作者是 Joyce Echessa--渥合数位服务创办人,毕业于台湾大学,近年来专注于协助客户进行 App 软体以及网站开发.本篇文章中,作者介绍通过 React Native 框 ...