-1

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

How can I do the same ? Pls. guide.

  • In TestContext.CurrentContext.Result.Assertions , I want to clear details based on some conditions and want to Pass my test. Other way I want is to override the 'SwTestBase.CurrentTest.Result' to Passed. – Hemant Pawar May 09 '23 at 07:47

1 Answers1

0

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();