如何将单元测试项目添加到现有的MVC3应用程序(从空模板) [英] How Can I Add a Unit Test Project to an Existing MVC3 Application (from empty template)

查看:109
本文介绍了如何将单元测试项目添加到现有的MVC3应用程序(从空模板)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从Empty模板创建了一个MVC3应用程序,因此无法将Visual Studio Unit测试项目添加到解决方案中.

I created an MVC3 application from the Empty template so I couldn´t add a Visual Studio Unit test project to the solution.

我做了一些更改,添加了一些控制器,现在我想尝试TDD,所以我需要添加一个测试框架.

I made some changes, added some controllers and now I want to try TDD so I need to add a framework for testing.

但是我看不到我该怎么做.

But I can´t see how I can do that.

我想要一种可以在解决方案资源管理器中创建测试项目的方法,例如带有一些基本文件夹和文件的"website.Test".

I want some way where I can create my test project right in the Solution Explorer, for example "website.Test" with some basic folders and files.

我在这里看到了有关如何添加单元测试的一些问题,但是这些问题是使用xUnit.net或NUnit的,我想要原始的VS测试框架.

I saw here some questions about how to add Unit tests, but those were with xUnit.net or NUnit and I want the original VS test framework.

我正在使用Visual Studio 2010 Professional.

I am using Visual Studio 2010 Professional.

我也想知道其他人对第三方单元测试框架的看法,它们更好吗?

I am also interested to know what others think about the 3rd-party unit test frameworks, are they better?

初学者呢?

推荐答案

要添加一个空的Test项目,只需转到File> Add> New Project,然后选择Test子类别> Test Project.

To add an empty Test project just go to File>Add>New Project choose Test subcategory > Test Project.

这篇关于如何将单元测试项目添加到现有的MVC3应用程序(从空模板)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆