当前位置: 首页>>代码示例>>C#>>正文


C# FixtureLibrary.FixtureFor方法代码示例

本文整理汇总了C#中StoryTeller.Model.FixtureLibrary.FixtureFor方法的典型用法代码示例。如果您正苦于以下问题:C# FixtureLibrary.FixtureFor方法的具体用法?C# FixtureLibrary.FixtureFor怎么用?C# FixtureLibrary.FixtureFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StoryTeller.Model.FixtureLibrary的用法示例。


在下文中一共展示了FixtureLibrary.FixtureFor方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetUp

        public void SetUp()
        {
            library = new FixtureLibrary();
            FixtureGraph fixture1 = library.FixtureFor("Math");
            fixture1.AddStructure("Grammar1", new Sentence());
            fixture1.AddStructure("Grammar2", new Sentence());
            fixture1.AddStructure("Grammar3", new Sentence());

            FixtureGraph fixture2 = library.FixtureFor("Arithmetic");
            fixture2.AddStructure("Grammar4", new Sentence());
            fixture2.AddStructure("Grammar5", new Sentence());
        }
开发者ID:adymitruk,项目名称:storyteller,代码行数:12,代码来源:FixtureExplorerTester.cs

示例2: UsageGraph

        public UsageGraph(FixtureLibrary library, IUsageGraphListener listener)
        {
            _library = library;
            _listener = listener;

            _fixtures.OnMissing = name =>
            {
                var fixture = library.FixtureFor(name);
                return new FixtureUsage(fixture);
            };
        }
开发者ID:MotherGoose,项目名称:storyteller,代码行数:11,代码来源:UsageGraph.cs

示例3: create_an_embeddedSection_grammar_structure

        public void create_an_embeddedSection_grammar_structure()
        {
            var library = new FixtureLibrary();
            FixtureGraph fixture = library.FixtureFor("Arithmetic");

            var grammar = new EmbeddedSectionGrammar<ArithmeticFixture>
            {
                Label = "The embedded section",
                Style = EmbedStyle.Inline
            }.LeafName("step name");
            var embeddedSection = grammar.ToStructure(library).ShouldBeOfType<EmbeddedSection>();

            embeddedSection.ShouldEqual(new EmbeddedSection(fixture, grammar.Label, grammar.LeafName()));
        }
开发者ID:ahjohannessen,项目名称:storyteller,代码行数:14,代码来源:EmbeddedSectionGrammarTester.cs

示例4: PossibleFixtures_uses_the_constraint_model_of_each_fixture_graph

        public void PossibleFixtures_uses_the_constraint_model_of_each_fixture_graph()
        {
            var library = new FixtureLibrary();
            library.FixtureFor("fixture1").Policies.IsPrivate = true;
            library.FixtureFor("fixture2").Policies.IsPrivate = false;
            library.FixtureFor("fixture3").Policies.IsPrivate = true;
            library.FixtureFor("fixture4").Policies.IsPrivate = false;

            library.PossibleFixturesFor(new Test("something")).ShouldHaveTheSameElementsAs(
                library.FixtureFor("fixture2"), library.FixtureFor("fixture4"));
        }
开发者ID:GaryLCoxJr,项目名称:StoryTeller2,代码行数:11,代码来源:FixtureLibraryTester.cs

示例5: FixtureGraph

    static FixtureGraph()
    {
        _library = new Lazy<FixtureLibrary>(() => {
                var library = new FixtureLibrary();

                _current.Value._fixtureTypes.Each((key, type) => {
                    var fixtureStructure = library.FixtureFor(key);

                    try
                    {
                        var fixture = (IFixture)Activator.CreateInstance(type);
                        fixtureStructure.ReadFrom(fixture, library);
                    }
                    catch (Exception ex)
                    {
                        fixtureStructure.LogError(ex);
                    }

                });

                return library;
            });
    }
开发者ID:GaryLCoxJr,项目名称:StoryTeller2,代码行数:23,代码来源:FixtureGraph.cs

示例6: SetUp

        public void SetUp()
        {
            library = new FixtureLibrary();
            library.FixtureFor("Math").Policies.IsPrivate = false;
            library.FixtureFor("Algebra").Policies.IsPrivate = false;
            library.FixtureFor("MathDetails").Policies.IsPrivate = true;
            library.FixtureFor("Calculus").Policies.IsPrivate = false;

            topFixture = library.BuildTopLevelGraph();

            mathSection = topFixture.GrammarFor("Math").ShouldBeOfType<EmbeddedSection>();
        }
开发者ID:GaryLCoxJr,项目名称:StoryTeller2,代码行数:12,代码来源:FixtureLibraryTester.cs

示例7: should_copy_the_style_from_the_grammar

        public void should_copy_the_style_from_the_grammar()
        {
            var library = new FixtureLibrary();
            FixtureGraph fixture = library.FixtureFor("Arithmetic");

            var grammar = new EmbeddedSectionGrammar<ArithmeticFixture>
            {
                Label = "The embedded section",
                Style = EmbedStyle.Inline
            }.LeafName("step name");
            var embeddedSection = grammar.ToStructure(library).ShouldBeOfType<EmbeddedSection>();

            embeddedSection.Style.ShouldEqual(EmbedStyle.Inline);
        }
开发者ID:ahjohannessen,项目名称:storyteller,代码行数:14,代码来源:EmbeddedSectionGrammarTester.cs


注:本文中的StoryTeller.Model.FixtureLibrary.FixtureFor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。