Ejemplo n.º 1
0
 public void TestSuiteContext_ThrowsOnMultipleCreate()
 {
     if (TestSuiteContext.Instance == null)
     {
         TestSuiteContext.Create();
     }
     Should.Throw <InvalidOperationException>(() => TestSuiteContext.Create());
 }
Ejemplo n.º 2
0
        public void TestSuiteContext_Terminate()
        {
            if (TestSuiteContext.Instance == null)
            {
                TestSuiteContext.Create();
            }

            TestSuiteContext.Instance.Terminate();
            TestSuiteContext.Instance.DisposedOnUtc.ShouldNotBe(default(DateTime));
        }
Ejemplo n.º 3
0
        public void TestSuiteContext_Create()
        {
            if (TestSuiteContext.Instance == null)
            {
                TestSuiteContext.Create();
            }
            var tsc = TestSuiteContext.Instance;

            tsc.CreatedOnUtc.ShouldNotBe(default(DateTime));
            tsc.TestSuiteId.IsNullOrEmpty().ShouldBeFalse();
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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));
        }
Ejemplo n.º 7
0
        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));
        }
Ejemplo n.º 8
0
 internal static void CreateTestSuiteContext()
 {
     TestSuiteContext.Create();
     EventPublisher.Publish(new OnTestSuiteCreatedEvent(TestSuiteContext.Instance));
 }