October 10, 2020

Commonly Used Attributes in Nunit

 Catagory- The Category attribute provides an alternative to suites for dealing with groups of tests. Either individual test cases or fixtures may be identified as belonging to a particular category

Description - -The Description attribute is used to apply descriptive text to a Test, TestFixture or Assembly

expected Condition -This is the way to specify that the execution of a test will throw an exception. This attribute has a number of positional and named parameters, which we will discuss in separate sections according to the purpose they serve.

Explicit -The Explicit attribute causes a test or test fixture to be ignored unless it is explicitly selected for running. The test or fixture will be run if it is selected in the gui, if its name is specified on the console runner command line as the fixture to run or if it is included by use of a Category filter.

ignore-The ignore attribute is an attribute to not run a test or test fixture for a period of time. The person marks either a Test or a TestFixture with the Ignore Attribute

Platform-The Platform attribute is used to specify platforms for which a test or fixture should be run

Properly -The Property attribute provides a generalized approach to setting named properties on any test case or fixture, using a name/value pair.

 

SetUp -This is the attribute that marks a class that contains the one-time setup or teardown methods for all the test fixtures under a given namespace. The class may contain at most one method marked with the SetUpAttribute 

TearDown-This attribute is used inside a TestFixture to provide a common set of functions that are performed after each test method is run. A TestFixture can have only one TearDown method

TestFixture -This is the attribute that marks a class that contains tests and, optionally, setup or teardown methods.

TestFixture Set Up- This attribute is used inside a TestFixture to provide a single set of functions that are performed once prior to executing any of the tests in the fixture.

TestFixture Tear Down--This attribute is used inside a TestFixture to provide a single set of functions that are performed once after all tests are completed

 Parallel test execution - do not declare static 

use [parallelizable]


No comments:

Post a Comment

Please let me know if you have any doubts.

Key concepts in Pipeline

 1. Agent- To build your code or deploy your software using azure pipelines, you need at least one agent. Two types of agent- Microsoft host...