Tag: mstest resharper

MSTest中忽略来自通用基类的inheritance测试类

在MSTest中创建通用基本测试类并从中inheritance时,我无法运行所有inheritance类的测试。 BaseDependencyPropertyFactoryTest位于Whathecode.PresentationFramework.Tests程序集中 。 它是通用基类。 ( BaseDependencyPropertyFactoryTest ) 两个程序集都有一个inheritance自此基类的测试,称为DependencyPropertyFactoryTest 。 所有inheritance的类都传递一个特定的类型参数。 [TestClass] public class DependencyPropertyFactoryTest : BaseDependencyPropertyFactoryTest { } 似乎只运行与基类位于同一程序集中的inheritance测试。 Whathecode.PresentationFramework.Aspects.Tests程序集中的inheritance测试似乎完全被忽略。 我究竟做错了什么? 如果需要,我可以上传所有必需的源代码,但是你需要PostSharp才能进行方面组装。 作为测试,我尝试将一个测试添加到方面程序集中的inheritance测试类中,该程序集调用基本测试类中的所有测试。 [TestMethod] public void AllBaseTests() { ClrGetterSetterTest(); DependencyPropertyGetterSetterTest(); } 这给出了以下结果。 奇怪的是,这个测试被执行了! 现在,这可能是一种至少运行它们的方法,但是当然每次在基类中添加额外的测试时我都不想编辑这个测试。 为什么跳过那些基础测试,为什么指示’中止’?