如何将单元测试项目添加到现有的MVC3应用程序(从空模板)

编程入门 行业动态 更新时间:2024-10-25 16:19:45
本文介绍了如何将单元测试项目添加到现有的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或NUnit的,我想要原始的VS测试框架.

I saw here some questions about how to add Unit tests, but those were with xUnit 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应用程序(从空模板)

本文发布于:2023-11-14 11:31:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1587098.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何将   应用程序   单元测试   模板   项目

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!