How Can I remove all details from TestContext.CurrentContext.Result.Assertions (NUnit.Framework)?

72 Views Asked by At

I want to empty/ remove all details packed in 'TestContext.CurrentContext.Result.Assertions'.

How can I do the same ? Pls. guide.

1

There are 1 best solutions below

0
Andrey Gurenkov On

Try this code, this test should pass with last 2 lines.

    try
    {
        Assert.True(1 == 2);
    }
    catch
    {
    }

    var context = TestExecutionContext.CurrentContext;
    context.CurrentResult = context.CurrentTest.MakeTestResult();