TestContext is particularly important in the context of ASP.NET web application as it provides an instance of Page object as TestContext.RequestPage. It is a reference System.Web.UI.Page object instantiated
TestContext class is equipped with two public methods: BeginTimer and EndTimer, which allow measuring the execution time of an individual unit test. In this way, time required to execute code under test can
TestContext.WriteLine allows additional information to be added in test reports (.trx files) in a flexible manner. This features is particularly useful to report contextual information such as details regarding Test Environments, formal
The current test run creates a unique directory for running tests and storing the generated reports (.trx) files.
In effect, additional inputs and outputs (especially, in case of data driven unit tests) can
From empirical evidence, we know that improving code coverage by verifying all the boundary conditions, and ensuring quality of code-base significantly enhances maintainability and comprehensibility of complex software systems. Therefore, writing effective unit