Example #1
0
        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;
        }
Example #2
0
        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;
 }
Example #5
0
 internal static void EndTestContextStepPartExecution(TestContextStepPart testContextStepPart)
 {
     testContextStepPart.ExecutionEndedOnUtc = DateTime.UtcNow;
     EventPublisher.Publish(new OnTestContextStepPartExecutionEndEvent(testContextStepPart));
 }
Example #6
0
 internal static void BeforeStartTestContextStepPartExecution(TestContextStepPart testContextStepPart)
 {
     EventPublisher.Publish(new OnBeforeTestContextStepPartExecutionStartEvent(testContextStepPart));
 }
Example #7
0
 internal static void DisposeTestContextStepPart(TestContextStepPart testContextStepPart)
 {
     testContextStepPart.DisposedOnUtc = DateTime.UtcNow;
     EventPublisher.Publish(new OnTestContextStepPartDisposedEvent(testContextStepPart));
 }
Example #8
0
 public OnTestContextStepPartDisposedEvent(TestContextStepPart testContextStepPart)
 {
     TestContextStepPart = testContextStepPart;
 }
Example #9
0
 private void EndTestContextStepPartExecution(TestContextStepPart stepPart)
 {
     TestLifetimePublisher.EndTestContextStepPartExecution(stepPart);
     TestLifetimePublisher.DisposeTestContextStepPart(stepPart);
 }
Example #10
0
 public OnTestContextStepPartExecutionEndEvent(TestContextStepPart testContextStepPart)
 {
     TestContextStepPart = testContextStepPart;
 }
 public OnTestContextStepPartCreatedEvent(TestContextStepPart testContextStepPart)
 {
     TestContextStepPart = testContextStepPart;
 }