Kentico 的 UnitTest 项目 9 测试在 Test-Explorer 中不可见

UnitTest Project by Kentico 9 Tests not visible in Test-Explorer

我在 Kentico 9 上创建自动化测试项目时遇到问题。

https://docs.kentico.com/display/K9/Creating+automated+test+projects 上有教程


问题是:如果我的测试Class继承自CMS.Tests.UnitTests

我的测试在 Visual Studio 2013 的测试浏览器中不再可见。

如果我的测试 Class 没有继承自 CMS.Tests.UnitTests 我可以在 Test-Explorer 中看到我的测试。





我使用 NUnit、VisualStudio 2013 Professional、Kentico 9

如何让它可见???

这可能是因为使用了错误版本的 NUnit。

您的测试项目必须引用 nunit.framework.dll(版本 2.6.3,位于 Lib 目录中)才能与 Kentico 9 中的 CMS.Tests.dll 正常工作。

您还需要为 NUnit 2.0 使用 NUnit 测试适配器(不是 NUnit3 测试适配器):https://marketplace.visualstudio.com/items?itemName=NUnitDevelopers.NUnitTestAdapter