自升级到新MSTestV2后无法运行有序测试 [英] Cannot run ordered tests since upgrading to new MSTestV2

查看:301
本文介绍了自升级到新MSTestV2后无法运行有序测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个单元测试项目,我已升级到使用新的MSTest TestFramework Unittest MSTesV2。

I have a unit test project that I have upgrade to using the new MSTest TestFramework Unittest MSTesV2.

由于升级我无法再运行有序测试。 原始有序测试显示所有测试的以下例外

Since upgrading I can no longer run an ordered test.  The original ordered test shows the following exeception for all tests

Result1名称:  01- UserContext_CanAddAndRemoveClassFromCache(aa usercontext)

结果1结果: 失败

结果1持续时间:  0:00:00

结果1 StackTrace:
$
结果1消息:  ;方法UnitTest.INVU.UserContext.UserContext.Initialize具有错误的签名。 参数1的类型应为Microsoft.VisualStudio.TestTools.UnitTesting.TestContext。

Result1 StandardOutput:

Result1 StandardError:

Result1 Name: 01- UserContext_CanAddAndRemoveClassFromCache (aa usercontext)
Result1 Outcome: Failed
Result1 Duration: 0:00:00
Result1 StackTrace:
Result1 Message: Method UnitTest.INVU.UserContext.UserContext.Initialize has wrong signature.  Parameter 1 should be of type Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.
Result1 StandardOutput:
Result1 StandardError:

If我创建了一个新的有序测试并运行它,然后只有第一个测试显示此异常。 然后跳过所有其他测试!

If I create a new ordered test and run it then only the first test shows this exception.  All other tests are then skipped!

签名是正确的!

但是,如果我实际上运行测试本身他们都运行正确!

However , if I actually run the tests themselves they all run correctly!

推荐答案

附加信息 - 启用失败后一个测试继续 - 另一个没有解释跳过....但仍无法让它们运行
Additional info - one test had continue after failure enabled - the other didn't which explains the skipping.... but still can't get them to run


这篇关于自升级到新MSTestV2后无法运行有序测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆