当前位置: 首页>>代码示例>>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;未经允许,请勿转载。