TestResult parentResult = new TestResult(); TestResult childResult = TestResult.Pass; parentResult.AddResult(childResult);
TestResult parentResult = new TestResult(); TestResult childResult = TestResult.Fail("Expected value is not equal to actual value"); parentResult.AddResult(childResult);
TestResult parentResult = new TestResult(); TestResult childResult = TestResult.Pass; childResult.Name = "MyCustomTestName"; parentResult.AddResult(childResult);In this example, we create a passing test result called childResult and set its name to "MyCustomTestName". We then add the child result to a parent result using the AddResult method. This can be useful when you want to give a more descriptive name to a test result than the default name generated by NUnit.