gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 02:20:56 25 4
gpt4 key购买 nike

我正在尝试获取 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com