Is defining TestMethod's in test base classes not supported by MsTest?

前端 未结 3 1614
南旧
南旧 2021-02-11 22:31

This question concerns a general unit test technique with a potentially very useful wide range of applicable scenarios. But it is easier to understand with an example to illustr

3条回答
  •  无人及你
    2021-02-11 22:48

    The TestClassAttribute allows you to put methods in the abstract base. The IgnoreAttribute excludes the base class from the list of tests. Without the IgnoreAttribute attribute methods within base are executed for both the base class and in subclasses marked with the TestClassAttribute, .

    [TestClass][Ignore]
    public abstract class EqualsFixtureBase
    {
    ....
    

提交回复
热议问题