當前位置: 首頁>>代碼示例>>C#>>正文


C# Test.Section方法代碼示例

本文整理匯總了C#中System.Test.Section方法的典型用法代碼示例。如果您正苦於以下問題:C# Test.Section方法的具體用法?C# Test.Section怎麽用?C# Test.Section使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Test的用法示例。


在下文中一共展示了Test.Section方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: create_example_test

        public void create_example_test()
        {
            var test = new Test("test1");
            test.Section("a");
            test.Section("b");
            test.Section("c");

            new FixtureLibrary().ModifyExampleTest(test);
            test.Name.ShouldEqual("All Fixtures");
            test.Parts.ShouldHaveTheSameElementsAs<ITestPart>(test.Parts);
        }
開發者ID:GaryLCoxJr,項目名稱:StoryTeller2,代碼行數:11,代碼來源:FixtureLibraryTester.cs

示例2: creates_example_test

        public void creates_example_test()
        {
            var template = new Test("some test");
            Section section = template.Section("Math");
            section.AddStep("step1");
            section.AddStep("step2");
            section.AddStep("step3");

            new FixtureGraph("Math").ModifyExampleTest(template);
            template.Parts.Count.ShouldEqual(1);
            template.Parts[0].ShouldBeOfType<Section>();
        }
開發者ID:wbinford,項目名稱:storyteller,代碼行數:12,代碼來源:FixtureGraphTester.cs

示例3: create_example_test

        public void create_example_test()
        {
            var test = new Test("some test");
            test.Section("a");
            test.Section("b");
            test.Section("c");
            Section section = new Section("Math").WithStep("MultiplyBy").WithStep("step1").WithStep("step2");
            test.Add(section);

            var structure = new StubGrammarStructure
            {
                Name = "MultiplyBy",
                Parent = new FixtureGraph("Math")
            };
            structure.ModifyExampleTest(test);

            test.Parts.Count.ShouldEqual(1);
            var theSection = test.Parts[0].ShouldBeOfType<Section>();

            theSection.Parts.Count.ShouldEqual(1);
            theSection.Parts[0].ShouldBeOfType<IStep>().GrammarKey.ShouldEqual("MultiplyBy");
        }
開發者ID:wbinford,項目名稱:storyteller,代碼行數:22,代碼來源:FixtureGraphTester.cs

示例4: give_it_a_whirl

        public void give_it_a_whirl()
        {
            var test = new Test("The First Test");

            test.Section<ArithmeticFixture>(x =>
            {
                x.WithStep("StartWith", "starting:100")
                    .WithStep("MultiplyBy", "multiplier:2")
                    .WithStep("TheValueShouldBe", "expected:200")
                    .WithStep("TheValueShouldBe", "expected:300")
                    .WithStep("Subtract", "operand:5")
                    .WithStep("TheValueShouldBe", "expected:195")
                    .WithStep("Adding", "x:10, y:23.5, returnValue:33.5")
                    .WithStep("Throw");
            });

            var runner = new TestRunner();
            HtmlDocument html = runner.WritePreview(test);
        }
開發者ID:GaryLCoxJr,項目名稱:StoryTeller2,代碼行數:19,代碼來源:SimpleTestRunningTester.cs

示例5: SetUp

        public void SetUp()
        {
            test = new Test("The First Test");

            test.Section<ArithmeticFixture>(x =>
            {
                x.WithStep("StartWith", "starting:100")
                    .WithStep("MultiplyBy", "multiplier:2")
                    .WithStep("TheValueShouldBe", "expected:200")
                    .WithStep("TheValueShouldBe", "expected:300")
                    .WithStep("Subtract", "operand:5")
                    .WithStep("Subtract", "")
                    .WithStep("TheValueShouldBe", "expected:195")
                    .WithStep("Adding", "x:10, y:23.5, returnValue:33.5")
                    .WithStep("Throw");
            });

            var runner = new TestRunner();

            runner.RunTest(test);
        }
開發者ID:GaryLCoxJr,項目名稱:StoryTeller2,代碼行數:21,代碼來源:SimpleTestRunningTester.cs


注:本文中的System.Test.Section方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。