public void TestCaseFinishedEventTest() { _lifecycle = Allure.DefaultLifecycle; var tsevt = new TestSuiteStartedEvent(SuiteUid, "suite42"); _lifecycle.Fire(tsevt); var tcsevt = new TestCaseStartedEvent(SuiteUid, "test name"); _lifecycle.Fire(tcsevt); var evt = new TestCaseFinishedEvent(); _lifecycle.Fire(evt); Assert.IsNull(_lifecycle.TestCaseStorage.Value); Assert.AreEqual(1, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases.Length); Assert.AreEqual("test name", _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].name); Assert.AreEqual(null, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].failure); Assert.AreEqual(null, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].attachments); Assert.AreEqual(null, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].steps); Assert.AreNotEqual(0, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].stop); }
public void TestCaseFinishedEventAfterTestCaseCancelledEventTest() { TestCaseCanceledEventTest(); var evt = new TestCaseFinishedEvent(); _lifecycle.Fire(evt); Assert.IsNull(_lifecycle.TestCaseStorage.Value); Assert.AreEqual(1, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases.Length); Assert.AreEqual("test name", _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].name); Assert.AreEqual(status.canceled, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].status); Assert.AreEqual("Test skipped with unknown reason", _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].failure.message); Assert.AreEqual(null, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].attachments); Assert.AreEqual(null, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].steps); Assert.AreNotEqual(0, _lifecycle.TestSuiteStorage.Get(SuiteUid).testcases[0].stop); }