4
Reply

What are the Annotations allowed for testing in N-Unit ?

SetUp, Test and TearDown : are annotations allowed for testing in NUnit

    I liked that the article focused on practical NUnit annotations instead of making unit testing feel overly complicated. The explanation of how [SetUp] and [TearDown] help organize tests was especially useful, because those are things beginners often forget when learning NUnit.
    Wacky Flip

    In NUnit, annotations are called attributes. They are used to define tests, control execution, provide data, and manage setup/teardown logic.

    Culture, random, retry, category, one time dear down, one time setup, test
    1) Category : Specifies one or more categories for the test 2) Culture : Specifies cultures for which a test or fixture should be run 3) Indicates : Indicates that a test should be skipped unless explicitly run 4) Ignore : Indicates that a test shouldn't be run for some reason 5) MaxTime : Specifies the maximum time in milliseconds for a test case to succeed 6) OneTimeSetUp : Identifies methods to be called once prior to any child tests 7) OneTimeTearDown : Identifies methods to be called once after all child tests 8) Platform : Specifies platforms for which a test or fixture should be run 9) Random : Specifies generation of random values as arguments to a parameterized test 10) Repeat : Specifies that the decorated method should be executed multiple times 11) Retry : Causes a test to rerun if it fails, up to a maximum number of times 12) TearDown : Indicates a method of a TestFixture called immediately after each test method 13) Test : Marks a method of a TestFixture that represents a test 14) TestCase : Marks a method with parameters as a test and provides inline arguments 15) Timeout : Provides a timeout value in milliseconds for test cases 16) SetUp : Indicates a method of a TestFixture called immediately before each test method