-
Notifications
You must be signed in to change notification settings - Fork 161
Order Attribute
jnm2 edited this page Mar 18, 2017
·
5 revisions
The OrderAttribute may be placed on a test method to specify the order in which tests are run. Ordering is given by the required order argument to the attribute, an int.
The following tests will be run in the order:
- TestA
- TestB
- TestC
public class MyFixture
{
[Test, Order(1)]
public void TestA() { ... }
[Test, Order(2)]
public void TestB() { ... }
[Test]
public void TestC() { ... }
}-
Tests with an
OrderAttributeargument are started before any tests without the attribute. -
Ordered tests are started in ascending order of the
orderargument. -
Among tests with the same
ordervalue or without the attribute, execution order is indeterminate. -
Tests do not wait for prior tests to finish. If multiple threads are in use, a test may be started while some earlier tests are still being run.
Copyright (c) 2018 The NUnit Project - Licensed under CC BY-NC-SA 4.0
-
NUnit
-
Release Notes
-
License
- Getting Started
- Writing Tests
- Running Tests
- Extending NUnit
- Technical Notes
-
Release Notes
- NUnit Xamarin Runners
- VS Test Adapter
- VS Test Generator
- NUnit Analyzers