多个测试类在 MSTest 中使用同一组类型固定装置
为了将MbUnit中的TypeFixture迁移到MSTest,我们可以为测试方法构建一个抽象类,以及继承该抽象类的其他一些类,其构造函数包含原始TypeFixture定义。
现在的问题是,在原始的 MbUnit 测试中,有多个测试类使用同一组 TypeFixture。做到这一点的方法是有一个包含这些装置的基类,并有实际的测试类来继承它。
我认为这不适用于 MSTest。 MSTest 中是否有任何解决方法可以实现相同的目标?谢谢!
In order to migrate TypeFixtures in MbUnit to MSTest, we can build an abstract class for test methods and some other classes that inherit the abstract class whose constructors contain the original TypeFixture definitions.
Right now the question is that in the original MbUnit test, there are multiple test classes that use the same set of TypeFixture. The way to do it is to have a base class that contains those fixtures, and have actual test classes to inherit it.
I don't think this works for MSTest. Is there any workaround in MSTest that accomplishes the same goal? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不好,但你可以使用反射。您将获得红色/绿色的 pr 类而不是方法,这意味着更难导航到中断测试:
Not good, but you can use reflection. You will get red / green pr class and not methods, which means it's harder to navigate to the breaking test: