【问题标题】:UnitTest Project by Kentico 9 Tests not visible in Test-ExplorerKentico 的 UnitTest 项目 9 测试在 Test-Explorer 中不可见
【发布时间】:2017-04-07 03:44:45
【问题描述】:

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

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


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

我的测试在我的 Visual Studio 2013 的测试资源管理器中不再可见。

如果我的测试类不继承自 CMS.Tests.UnitTests,我可以在 Test-Explorer 中查看我的测试。





我使用 NUnit、VisualStudio 2013 Professional、Kentico 9

我怎样才能让它可见???

【问题讨论】:

  • 你确定它是继承自 CMS.Tests.UnitTests 吗?
  • 如您在第二张图片(黄色)上所见。使用在顶部。
  • 正确,但它可能引用了另一个 UnitTests 类。但我假设你已经检查过了

标签: unit-testing inheritance visual-studio-2013 nunit kentico


【解决方案1】:

这可能是由于使用了不正确的 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-15
    • 2018-09-12
    • 2021-09-03
    • 2016-10-18
    相关资源
    最近更新 更多