コード例 #1
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);
        }
コード例 #2
0
ファイル: TestContextTests.cs プロジェクト: saturn72/Titan
        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);
        }
コード例 #3
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));
        }