The TestContext is the class allows tests to access certain information about the execution context.
To get the information of the Test such as Method name, Class Name, Properties of the Test, Result of the Test , Nunit provides TestContext class.
In the automated test, the Test information will be useful,
Example :
- If the test is failed the screenshot can be taken.
- If the test is failed then the next action can be performed.
- To get the clear reporting Test name / Class name will be helpful.
Test status,stackrace,properties are preferred in Tear down method
Test stackrace are preferred in Tear down method