We will discuss about frequently used ones to run test scenarious properly. You would find comparisons of NUnit, MSTest, xUnit.net and JUnit testing frameworks down below.
NUnit | MSTest | xUnit.net | JUnit | Description |
---|---|---|---|---|
[TestClass] | – | – | Indicates that the class has test methods. | |
[Test] | [TestMethod] | [Fact] | @Test | Marks a test case. |
[OneTimeSetUp] | [ClassInitialize] | IClassFixture | @BeforeClass | The one time triggered method before test cases start. |
[OneTimeTearDown] | [ClassCleanup] | IClassFixture | @AfterClass | The one time triggered method after test cases end. |
[SetUp] | [TestInitialize] | Constructor | @Before | Triggered before every test case. |
[TearDown] | [TestCleanup] | IDisposable.Dispose | @After | Triggered after every test case. |
[Ignore] | [Ignore] | [Fact(Skip=”reason”)] | @Ignore | Ignores the test case. |
[Category(“”)] | [TestCategory(“”)] | [Trait(“Category”, “”)] | @Category(*.class) | Categorizes the test cases or classes. |
There is a little difference between them except that the xUnit framework. xUnit prefers inheritance for the ones that it
No comments:
Post a Comment