TestDriven.NET 运行程序无法与 Silverlight 3 和 MSTest 配合使用

发布于 2024-09-07 11:33:19 字数 377 浏览 1 评论 0原文

我目前正在 Visual Studio 2010 中开发一个使用 MSTest for Silverlight 的项目。我最近从 Visual Studio 2008 转换了这个项目,其中基于 Silverlight 的测试运行没有问题。但是,当我尝试使用 TestDriven.NET 在 VS 2010 中的测试类范围(或超出范围,即“运行所有测试”)运行单元测试时,出现以下错误:

目标类型不包含来自已知测试框架或“Main”方法的测试。

如果测试不需要任何设置方法或构造函数,TestDriven.NET 将运行单独的测试。在我看来,由于某种原因,它没有执行 [TestInitialize] 装饰的测试方法。

有什么想法吗?

I am currently working on a project in Visual Studio 2010 that uses MSTest for Silverlight. I had recently converted this project from Visual Studio 2008 where the Silverlight-based tests ran without issue. However, when I try to run the unit tests at a test class scope (or beyond, i.e. "run all tests") in VS 2010 with TestDriven.NET I get the following error:

The target type doesn't contain tests from a known test framework or a 'Main' method.

If a test doesn't require any setup method or constructor, TestDriven.NET will run an individual test. It would appear to me that for some reason it isn't executing [TestInitialize] decorated test method.

Any thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

囍孤女 2024-09-14 11:33:19

“MSTest for Silverlight”是什么意思?

1

您不能使用传统的单元测试框架,因为它们不是针对 Silverlight 库构建的(例如 VS2010 测试项目)
这就是微软提出“Silverlight单元测试框架”的原因

2

“Silverlight单元测试框架”中的测试只能在浏览器中运行,而不能在Testdriven.NET运行器中运行

What do you mean by "MSTest for Silverlight"?

1

You cant use traditional unit testing frameworks, because they are not built against Silverlight libraries (e.g. the VS2010 Test project)
That's the reason why Microsoft came up with the "Silverlight Unit Test Framework"

2

Tests in "Silverlight Unit Testing Framework" can run only in a browser, not the Testdriven .NET runner

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文