SetUp, Test and TearDown : are annotations allowed for testing in NUnit
Interviews3 answers
What are the Annotations allowed for testing in N-Unit ?
3 Answers
In NUnit, annotations are called attributes. They are used to define tests, control execution, provide data, and manage setup/teardown logic.
AlicessPosted Dec 18, 2025, 2:17 AM EST
Culture, random, retry, category, one time dear down, one time setup, test
Selvakumar RajuPosted Jul 31, 2023, 2:15 AM EDT
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
Pranam BhatPosted May 22, 2021, 10:09 AM EDT


