當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。