Zobrazujú sa príspevky s označením Atributes. Zobraziť všetky príspevky
Zobrazujú sa príspevky s označením Atributes. Zobraziť všetky príspevky

pondelok 9. januára 2012

Unit Test Atributes in commom testing frameworks

I'm rewriting some my old test classes, writed in NUnit to the "new" MS Test.
I was looking for the alternative of TestFixtureTearDown

and Whoa la, I found this very usefull table:


NUnit 2.x MbUnit 2.4 MSTest xUnit.net
[Test] [Test] [TestMethod] [Fact]
[TestFixture] [TestFixture] [TestClass] n/a
[ExpectedException] [ExpectedException] [ExpectedException] Assert.Throws or Record.Exception
[SetUp] [SetUp] [TestInitialize] Constructor
[TearDown] [TearDown] [TestCleanup] IDisposable.Dispose
[TestFixtureSetUp] [TestFixtureSetUp] [ClassInitialize] IUseFixture<T>
[TestFixtureTearDown] [TestFixtureTearDown] [ClassCleanup] IUseFixture<T>
[Ignore] [Ignore] [Ignore] [Fact(Skip="reason")]
n/a [Timeout] [Timeout] [Fact(Timeout=n)]
[Property] n/a [TestProperty] [Trait]
n/a [Row], [RowTest] [DataSource] [Theory], [XxxData]