Console.WriteLine( “TearDown” );
}
[Test]
public void Test1()
{
Console.WriteLine( “Test1” );
}
}
}
程序的输出将是下面的结果::
TestFixtureSetUp
SetUp
Test1
TearDown
SetUp
Test2
TearDown
TestFixtureTearDown
如果Test2单独执行输出的结果将是:
TestFixtureSetUp
SetUp
文章来源于领测软件测试网 https://www.ltesting.net/