public void SetResult_Ignore() { TestSuiteTreeNode node = new TestSuiteTreeNode(testCaseInfo); TestCaseResult result = new TestCaseResult(testCaseInfo); result.Ignore("reason"); node.Result = result; Assert.AreEqual("NUnit.Tests.Assemblies.MockTestFixture.MockTest1", node.Result.Name); Assert.AreEqual(TestSuiteTreeNode.IgnoredIndex, node.ImageIndex); Assert.AreEqual(TestSuiteTreeNode.IgnoredIndex, node.SelectedImageIndex); Assert.AreEqual("Ignored", node.StatusText); }
private TestSuiteResult NotRunTestSuite() { TestSuiteResult result = new TestSuiteResult("RootSuite"); result.RunState = RunState.Executed; TestCaseResult testCaseResult = new TestCaseResult("NonRunTestCase"); testCaseResult.Ignore("No Reason"); result.AddResult(testCaseResult); return(result); }
private TestSuiteResult MockSuiteResult(string suiteName, bool failure) { TestSuiteResult result = new TestSuiteResult(suiteName); result.Time = time; result.RunState = RunState.Executed; TestSuiteResult level1SuiteA = new TestSuiteResult("level 1 A"); result.AddResult(level1SuiteA); level1SuiteA.RunState = RunState.Executed; TestSuiteResult level1SuiteB = new TestSuiteResult("level 1 B"); result.AddResult(level1SuiteB); level1SuiteB.RunState = RunState.Executed; testCase = new TestCaseResult("a test case"); if (failure) { testCase.Failure("argument exception", null); } else { testCase.Success(); } level1SuiteA.AddResult(testCase); testCase = new TestCaseResult("a successful test"); testCase.Success(); level1SuiteB.AddResult(testCase); testCase = new TestCaseResult("a not run test"); testCase.Ignore("test not run"); level1SuiteB.AddResult(testCase); return(result); }
public void TestCaseNotRun() { caseResult.Ignore("because"); Assert.AreEqual(false, caseResult.Executed); Assert.AreEqual("because", caseResult.Message); }