asp.net-mvc - 无法让 MvcIntegrationTestFramework 工作

标签 asp.net-mvc integration-testing mstest

我正在尝试获取 Steven Sanderson 的 MvcIntegrationTestFramework与我们的 MVC 4 应用程序一起使用。我真的很喜欢能够编写不需要浏览器但测试整个流程的集成测试的想法。

我无法让它运行。当我执行一个非常简单的测试时,我得到的只是:

Unable to create instance of class website.tests.UnitTest1. Error: System.InvalidOperationException: Could not load MvcIntegrationTestFramework.dll within a bin directory under C:[path]\Website. Is this the path to your ASP.NET MVC application, and have you set up a post-build event to copy your test assemblies and their dependencies to this folder? See the demo project for an example..

这是 MVC 应用程序的正确路径,我已将测试项目放在解决方案中的旁边。我还设置了构建后复制字符串,它复制了 .dll 文件,我通过在 MVC 应用程序 bin 文件夹中查找来验证这些文件。它仍然声称找不到 MvcIntegrationTestFramework.dll

我使用 MSTest 作为测试框架。

有人知道如何解决这个问题吗?

最佳答案

此版本已针对 MVC3 进行了更新,到目前为止我已经获得了相当不错的结果:

https://github.com/JonCanning/MvcIntegrationTestFramework

我也 fork 了这个并添加了对文件上传的支持。

https://github.com/Steji/MvcIntegrationTestFramework

关于asp.net-mvc - 无法让 MvcIntegrationTestFramework 工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10270030/

相关文章:

asp.net-mvc - WebApi 帮助页面说明

javascript - 在 MVC 5 中实现一个登录 LinkedIn 的窗口

java - Maven Failsafe 插件总是跳过集成测试

database - MSTest 单元测试和数据库访问,无需接触实际数据库

.net - 如何使用 "proper"调用堆栈创建自定义 MSTest 断言方法

MSTest:从公共(public)目录部署项目的明智方法?

c# - 在 ASP.NET Core 中使用 WebGrid

asp.net - 目录上的 "401 Unauthorized"

java - Jenkins 在多个操作系统上进行集成测试

c# - 编写可测试的 "import data from database"类