private void SetStepFailInformation(Tools.StepFailInformation stepFailInformation) { if (stepFailInformation.Comment != null) { _currentTestStepResult.ErrorMessage = stepFailInformation.Comment; } }
private void FailTestStep(Tools.StepFailInformation stepFailInformation = null) { TestOutCome = TestOutcome.Failed; if (_currentTestStepResult == null) { throw new NullReferenceException("CurrentTestStepResult is null. Developer probably forgot to call InitTestStep()"); } SetStepFailInformation(stepFailInformation); FinishTestStep(TestOutcome.Failed); }
public ITestIterationResult SetStepResults(List <TestStep> testSteps) { int stepCount = 1; foreach (var step in testSteps) { InitTestStep(); if (step.Result != null && NotAllNull(step.Result.Exception, step.Result.RefToScreenshot, step.Result.AddtionalInformation)) { ResultBlob = new TestStepResultBlob(stepCount, step.Result.RefToScreenshot, step.Result.AddtionalInformation, step.Result.Exception); } if (step.Result == null) { FailTestStep(new Tools.StepFailInformation("Result var null. Ikke kjørt eller bug i testcasen")); break; } if (!step.Result.Success) { var stepFailInfo = new Tools.StepFailInformation(step.Result.ErrorMessage); FailTestStep(stepFailInfo); break; } else { CloseTestStep(); } stepCount++; } return(GetTestResult()); }