private void HandleError(TestContextStepPart stepPart) { var ex = new AutomationException( "failure while running {0} with parameters: [{1}]".AsFormat(stepPart.Name, stepPart.Parameters), stepPart.Exception); stepPart.Exception = ex; throw ex; }
internal static TestContextStepPart CreateTestContextStepPart(TestContextStep step, MethodInfo methodInfo, IEnumerable <object> parameters) { var tcsp = new TestContextStepPart(step, methodInfo, parameters); step.TestContextStepParts.Add(tcsp); EventPublisher.Publish(new OnTestContextStepPartCreatedEvent(tcsp)); return(tcsp); }
public void TestContextStep_Create() { if (TestSuiteContext.Instance == null) { TestSuiteContext.Create(); } var parameters = new object[] { "this is params", "wer" }; var mi = this.GetType().GetMethod("TestContextStep_Create"); var tc = new Framework.Testing.TestContext(mi, parameters, null, TestSuiteContext.Instance); var tcs = new TestContextStep(tc, mi, parameters); var part = new TestContextStepPart(tcs, mi, parameters); part.Name.ShouldBe(mi.Name); part.TestContextStep.ShouldBe(tcs); part.Parameters.ShouldBe(parameters); part.ExecutionId.IsNullOrEmpty().ShouldBeFalse(); part.CreatedOnUtc.ShouldNotBe(default(DateTime)); }
public OnBeforeTestContextStepPartExecutionStartEvent(TestContextStepPart testContextStepPart) { TestContextStepPart = testContextStepPart; }
internal static void EndTestContextStepPartExecution(TestContextStepPart testContextStepPart) { testContextStepPart.ExecutionEndedOnUtc = DateTime.UtcNow; EventPublisher.Publish(new OnTestContextStepPartExecutionEndEvent(testContextStepPart)); }
internal static void BeforeStartTestContextStepPartExecution(TestContextStepPart testContextStepPart) { EventPublisher.Publish(new OnBeforeTestContextStepPartExecutionStartEvent(testContextStepPart)); }
internal static void DisposeTestContextStepPart(TestContextStepPart testContextStepPart) { testContextStepPart.DisposedOnUtc = DateTime.UtcNow; EventPublisher.Publish(new OnTestContextStepPartDisposedEvent(testContextStepPart)); }
public OnTestContextStepPartDisposedEvent(TestContextStepPart testContextStepPart) { TestContextStepPart = testContextStepPart; }
private void EndTestContextStepPartExecution(TestContextStepPart stepPart) { TestLifetimePublisher.EndTestContextStepPartExecution(stepPart); TestLifetimePublisher.DisposeTestContextStepPart(stepPart); }
public OnTestContextStepPartExecutionEndEvent(TestContextStepPart testContextStepPart) { TestContextStepPart = testContextStepPart; }
public OnTestContextStepPartCreatedEvent(TestContextStepPart testContextStepPart) { TestContextStepPart = testContextStepPart; }