Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Usefull NUnit Attributes

Usefull NUnit Attributes

Attribute Description
[Category(string)] Specifies one or more categories for the test.
[Description(string)] Applies descriptive text to a Test, TestFixture or Assembly.
[Explicit] Indicates that a test should be skipped unless explicitly run.
[Ignore]
[Maxtime(milliseconds)] Specifies the maximum time in milliseconds for a test case to succeed.
[Order(int)] Specifies the order in which decorated test should be run (against others).
[Pairwise] https://github.com/nunit/docs/wiki/Pairwise-Attribute
[Random(min, max, int count)] Generate random values on a parameter.
[Range(from, to, step)] Run test with parameter value in a range.
[Value(...)] Run test with parameter values provided.
[Retry(int)] Retry a test if it fails.
[SetUp] Something to run before every test.
[TearDown] Somethin to run after every test.
[Test] A method that tests something.
[TestCase(parameters)] Test method with specified parameters.
[TestFixture] Marks a class that contains tests.
[TestOf(type)] Defines what type are the tests for.
[Timeout(milliseconds)] After the specified time the tests is cancelled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment