本文整理汇总了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());
}
示例2: UsageGraph
public UsageGraph(FixtureLibrary library, IUsageGraphListener listener)
{
_library = library;
_listener = listener;
_fixtures.OnMissing = name =>
{
var fixture = library.FixtureFor(name);
return new FixtureUsage(fixture);
};
}
示例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()));
}
示例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"));
}
示例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;
});
}
示例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>();
}
示例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);
}