public void TestSuiteContext_ThrowsOnMultipleCreate() { if (TestSuiteContext.Instance == null) { TestSuiteContext.Create(); } Should.Throw <InvalidOperationException>(() => TestSuiteContext.Create()); }
internal static TestContext CreateTestContext(MethodInfo methodInfo, IEnumerable <object> parameters, string[] tags, TestSuiteContext testSuiteContext) { var tc = new TestContext(methodInfo, parameters, tags, testSuiteContext); EventPublisher.Publish(new OnTestContextCreatedEvent(tc)); return(tc); }
public void TestSuiteContext_Terminate() { if (TestSuiteContext.Instance == null) { TestSuiteContext.Create(); } TestSuiteContext.Instance.Terminate(); TestSuiteContext.Instance.DisposedOnUtc.ShouldNotBe(default(DateTime)); }
public void TestSuiteContext_Create() { if (TestSuiteContext.Instance == null) { TestSuiteContext.Create(); } var tsc = TestSuiteContext.Instance; tsc.CreatedOnUtc.ShouldNotBe(default(DateTime)); tsc.TestSuiteId.IsNullOrEmpty().ShouldBeFalse(); }
public void TestSuiteContext_CurrentTestContext() { TestSuiteContext.Create(); var tsc = TestSuiteContext.Instance; const string tcName = "Name"; var mi = GetType().GetMethod("TestSuiteContext_CurrentTestContext"); var parameters = new[] { "para,etsr" }; var tc = new Titan.Framework.Testing.TestContext(mi, parameters, null, tsc); tsc.CurrentTestContext().ShouldBe(tc); }
public void TestContext_CreateInstance() { TestSuiteContext.Create(); var tsc = TestSuiteContext.Instance; var tags = new [] { "a", "b", "c" }; var parameters = new[] { "parameters" }; var mi = GetType().GetMethod("TestContext_CreateInstance"); var tc = new Titan.Framework.Testing.TestContext(mi, parameters, tags, tsc); tc.Name.ShouldBe(mi.Name); tc.Parameters.ShouldBe(parameters); tc.Tags.ShouldBe(tags); tc.CreatedOnUtc.ShouldNotBe(default(DateTime)); tc.TestSuiteContext.ShouldBe(tsc); tc.ExecutionId.IsNullOrEmpty().ShouldBeFalse(); tsc.TestContexts.Last().ShouldBe(tc); }
public void TestContextStep_Create() { if (TestSuiteContext.Instance == null) { TestSuiteContext.Create(); } var parameters = new[] { "invocationParams" }; var mi = GetType().GetMethod("TestContextStep_Create"); var tc = new TestContext(mi, parameters, null, TestSuiteContext.Instance); var tcs = new TestContextStep(tc, mi, parameters); tcs.Name.ShouldBe(mi.Name); tcs.Parameters.ShouldBe(parameters); tcs.TestContext.ShouldBe(tc); tcs.ExecutionId.IsNullOrEmpty().ShouldBeFalse(); tcs.CreatedOnUtc.ShouldNotBe(default(DateTime)); }
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 OnTestSuiteExecutionStartedEvent(TestSuiteContext testSuiteContext) { TestSuiteContext = testSuiteContext; }
public OnTestSuiteCreatedEvent(TestSuiteContext testSuiteContext) { TestSuiteContext = testSuiteContext; }
public OnBeforeTestSuiteExecutionStartEvent(TestSuiteContext testSuiteContext) { TestSuiteContext = testSuiteContext; }
public OnTestSuiteDisposedEvent(TestSuiteContext testSuiteContext) { TestSuiteContext = testSuiteContext; }
internal static void CreateTestSuiteContext() { TestSuiteContext.Create(); EventPublisher.Publish(new OnTestSuiteCreatedEvent(TestSuiteContext.Instance)); }