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


C# FixtureLibrary.ApplyOverrides方法代碼示例

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


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

示例1: copies_grammars

        public void copies_grammars()
        {
            const string fixtureKey = "a key";

            var lib = new FixtureLibrary();
            var original = new FixtureModel(fixtureKey);
            lib.Models[fixtureKey] = original;

            original.AddGrammar(new Sentence { key = "sentence", format = "a format"});

            var overrides = new FixtureLibrary();
            var overriden = new FixtureModel(fixtureKey);
            overrides.Models[fixtureKey] = overriden;

            var result = lib.ApplyOverrides(overrides);

            result.Models.Count.ShouldBe(1);

            var fixture = result.Models[fixtureKey];
            ReferenceEquals(fixture, overrides.Models[fixtureKey]).ShouldBeFalse();
            fixture.key.ShouldBe(fixtureKey);

            fixture.grammars.Length.ShouldBe(1);

            var sentence = fixture.grammars[0] as Sentence;
            sentence.key.ShouldBe("sentence");
            sentence.format.ShouldBe("a format");
        }
開發者ID:storyteller,項目名稱:Storyteller,代碼行數:28,代碼來源:FixtureLibraryTester.cs

示例2: tracks_when_a_fixture_is_missing_from_code

        public void tracks_when_a_fixture_is_missing_from_code()
        {
            const string key = "a key";

            var lib = new FixtureLibrary();

            var overrides = new FixtureLibrary();
            overrides.Models[key] = new FixtureModel(key);

            var result = lib.ApplyOverrides(overrides);

            result.Models[key].IsMissing.ShouldBeTrue();
        }
開發者ID:storyteller,項目名稱:Storyteller,代碼行數:13,代碼來源:FixtureLibraryTester.cs

示例3: copies_from_overrides_when_not_in_original

        public void copies_from_overrides_when_not_in_original()
        {
            const string key = "a key";

            var lib = new FixtureLibrary();

            var overrides = new FixtureLibrary();
            overrides.Models[key] = new FixtureModel(key);

            var result = lib.ApplyOverrides(overrides);

            result.Models.Count.ShouldBe(1);

            var fixture = result.Models[key];
            fixture.key.ShouldBe(key);
        }
開發者ID:storyteller,項目名稱:Storyteller,代碼行數:16,代碼來源:FixtureLibraryTester.cs

示例4: overrides_original_title

        public void overrides_original_title()
        {
            const string key = "a key";

            var lib = new FixtureLibrary();
            var original = new FixtureModel(key);
            original.title = "A title";
            original.implementation = "some implementation";
            lib.Models[key] = original;

            var overrides = new FixtureLibrary();
            var overriden = new FixtureModel(key);
            overriden.title = "A new title";
            overrides.Models[key] = overriden;

            var result = lib.ApplyOverrides(overrides);

            result.Models.Count.ShouldBe(1);

            var fixture = result.Models[key];
            ReferenceEquals(fixture, overrides.Models[key]).ShouldBeFalse();
            fixture.title.ShouldBe(overriden.title);
            fixture.implementation.ShouldBe(original.implementation);
        }
開發者ID:storyteller,項目名稱:Storyteller,代碼行數:24,代碼來源:FixtureLibraryTester.cs


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