从 MbUnit 切换到 MSTest 时,MSTest 找不到测试

发布于 2024-08-04 06:13:37 字数 421 浏览 0 评论 0原文

我们有一个测试项目,最初是 MbUnit v3 / Gallio,但决定使用 MSTest。我们取出 Gallio/MbUnit 测试并添加对 MSTest 内容 (Microsoft.VisualStudio.QualityTools.UnitTestFramework) 的引用,并替换 C# 属性以使用 MSTest 措辞([TestMethod] 等),但是当尝试运行 Visual 测试时Studio 根本看不到测试。一切都编译得很好,但“测试”视图完全是空的。

文本的语法与任何其他 MSTest 项目完全相同。我宁愿知道这个项目有什么不同,并手动合并 VS 正在寻找的任何内容,而不是删除并重新创建测试项目,因为该项目已经在 TFS 中并且不想删除历史记录。

感谢您的任何帮助。


问题解决了,是我的错。我忘记将 [TestClass] 添加到班级中。瘸。

We had a test project that started out as MbUnit v3 / Gallio but decided to go to MSTest. We took out the Gallio/MbUnit tests and added the reference to the MSTest stuff (Microsoft.VisualStudio.QualityTools.UnitTestFramework) and swapped out the C# attributes to use MSTest verbiage ([TestMethod], etc), but when attempting to run tests Visual Studio doesn't see the tests at all. Everything compiles fine, but the Tests view is completely empty.

The syntax of the text is exactly the same as any other MSTest project. I'd rather know what's different about this project and hand-merge whatever VS is looking for than delete and recreate the test project since the project is already in TFS and don't want delete history.

Thanks for any help.


Problem solved, it was my fault. I forgot to add [TestClass] to the class. Lame.

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

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

发布评论

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

评论(1

守护在此方 2024-08-11 06:13:37

制作 csproj 文件的备份副本。
打开测试项目文件 (.csproj) 并将 ProjectTypeGuids 节点替换为以下值。

<PropertyGroup>
......
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>

{3AC096D0-A1C2-E12C-1390-A8335801FDAB}表示测试项目。
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 表示 2008 年解决方案。

Make a backup copy of the csproj file.
Open your test projcet file(.csproj) and replace the ProjectTypeGuids node with the following value.

<PropertyGroup>
......
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>

{3AC096D0-A1C2-E12C-1390-A8335801FDAB} means test project.
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} means 2008 solution.

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