In NUnit v. <3.0 there was a TestContext class, and there was a property that could tell us about the status of a previously executed test.
To access the property, we can use TestContext.CurrentContext.Result.Status
Now in NUnit 3.0 there is no property like Status ! Therefore, all my tests need to be changed.
My question is this: is it possible to get test status in NUnit 3.0, as was possible in the previous version?
An interesting thing : there was a TestStatus class with properties: Passed, Failed , etc., and we used it to compare with the current status. This class is present in NUnit 3.0!
My code is:
if (TestContext.CurrentContext.Result.Status == TestStatus.Failed) { //Be happy if it works) }
source share