I want to compare the current test method name, but getting an exception that TestContext returns null.
public TestContext TestContext { get; set; }
private void SetTaxCode(Bene beneDetails)
{if (TestContext.TestName.Contains("NegativeTest"))
{SetBenecode(TestDataProvider.TestDataProvider.InValidBeneficiaryTaxCode);
}
else
SetBenecode(beneDetails.BeneficiaryTaxCode);
}
TestContext.TestName returns correct test name in the basic.cs, but I can't inherit basic.cs to the new class, how can I then use TestContext in different classes?