本文整理匯總了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");
}
示例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();
}
示例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);
}
示例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);
}