Although there are many attributes, we will cover the important ones here. Add a new template specifier for Template Based Naming to support TestFixture arguments in test case name. If multiple [SetUp] methods are declared in a single class NUnit cannot guarantee the order of execution. In Nunit 2.x.x versions, the NUnit is designed in such a way that you are free to use it anywhere ie. The TestFixtureSetUp attribute is inherited from any base class. TestAttribute => [Test] The [Test] attribute is a way to mark method inside a [TextFixture] class as test method. Multiple Teardown required when use with inheritance. And ServiceFixture inherits from Service. Before NUnit 2.5, you were permitted only one TestFixtureSetUp method. Basically I need to do something like this: Before NUnit 2.5, you were permitted only one TearDown method. This is, by the way, a really non-orthodox way of writing a test fixture (at least in C#, Java, Scala, languages that I am more acquainted with). When running tests using dotnet test only the test case name is shown and used by default. Parallel execution of methods within a class is supported starting with NUnit 3.7. using NUnit.Framework; namespace SampleWebApplicationTests { [TestFixture] public partial class SampleNewsServiceTests { [SetUp] public void Setup() { // Service initialisation and other setups } } } The setup or ‘base’ class – SampleNewsServiceTests.cs From NUnit 2.5, we can use more than one Teardown methods under a Test Fixture. Therefore, if a base class has defined a SetFixtureSetUp method, that method will be called after each test method in the derived class. For use by dotnet test in terminal or the dotnet VSTS Task. Nowadays NUnit supports generic test classes and the TestFixture attribute can be used to supply the specific types to be used when the test is run. Inheritance. VS Output: No tests found to run. your inherit class can also use these attributes. dotnet test example.csproj -t gives The following Tests are available: Test_Example() Inheritance. I wrote a blog post about how to test every implementer of an interface showcasing these features. Description / background. I'm trying to partition a unit test class into logical groupings based on a specific scenario. Earlier to NUnit version 2.5, there could create only one Teardown attribute method. In earlier releases, parallel execution only applies down to the TestFixture level, ParallelScope.Childrenworks as ParallelScope.Fixtures and any ParallelizableAttribute placed on a method is ignored. However, I require to have a TestFixtureSetUp and TestFixtureTearDown that will run for the entire test. When inheriting NUnit will always run the '[SetUp]' method in the base class first. Therefore, if a base class has defined a TearDown method, that method will be called after each test method in the derived class. From version 2.0 on, NUnit has used custom attributes for this purpose. Nice answer! 1. The TearDown attribute is inherited from any base class. When I run test that is in test fixture that inherits from class containing [SetUp] AND/OR [TearDown] AND/OR [TestFixture] attribute and is located in different assembly, then test is NOT discovered. So Service is the SUT, the class under test, and ServiceFixture is the test fixture. Request. See here for further information. – Marjan Venema Mar 28 '15 at 18:38 Because NUnit test fixtures do not inherit from a framework class, the developer is free to use inheritance in other ways. E.g. If a test class marked with the TestFixture attribute is abstract, NUnit marks the tests as ignored. Version 1 of NUnit used the classic approach to identifying tests based on inheritance and naming conventions.