void ITestStream.StartEmbeddedSection(EmbeddedSection section, IStep step) { var sectionTag = new EmbeddedSectionTag(section, step); sectionTag.WriteResults(_context); _document.Push(sectionTag); }
public void with_embed_child() { var embed = new EmbeddedSection { fixture = new FixtureModel("Something"), title = "Do a bunch of things" }; embed.ToMissingCode(true).ShouldContain("[StoryTeller.Hidden]"); }
public void should_call_the_embedded_section_method() { var visitor = MockRepository.GenerateMock <IGrammarVisitor>(); var step = new Step(); var section = new EmbeddedSection(); section.AcceptVisitor(visitor, step); visitor.AssertWasCalled(x => x.EmbeddedSection(section, step)); }
public void StartEmbeddedSection(EmbeddedSection section, IStep step) { withNewNode(step, Icon.EmbeddedSection, node => { node.AddText(section.Label); addRearrangeCommands(node); StepLeaf leaf = section.LeafFor(step); node.Holder = leaf; _configurer.ConfigurePartAdders(node, section.Fixture, leaf); }); }
public void adding_an_embedded_section_then_a_sentence_under_a_paragraph_should_still_have_adder_commands() { var embedded = new EmbeddedSection(new FixtureGraph("Embed"), "the label", "embed"); treeBuilder.StartEmbeddedSection(embedded, step); var sentence = new Sentence(); var sentenceStep = new Step(); treeBuilder.Sentence(sentence, sentenceStep); nodeBuilder.AssertWasCalled(x => x.ConfigureRearrangeCommands(treeBuilder.LastNode, embedded.LeafFor(step), sentenceStep)); }
public EmbeddedSectionTag(EmbeddedSection section, IStep step) : base("div") { _section = section; _step = step; AddClass("embedded"); AddClass(section.Style.ToString()); if (section.Style == EmbedStyle.TitledAndIndented) { Add("h3").AddClass("embedded-title").Text(section.Label).Title("{0} (Embeds {1})".ToFormat(section.Name, section.Fixture.FixtureClassName)); } }
protected override void theContextIs() { step = new Step().With("x", 1).With("y", 2); treeBuilder.StartTest(theTest); section = new Section("Math"); treeBuilder.StartTest(theTest); treeBuilder.StartSection(section, new FixtureGraph("Math")); theFixture = new FixtureGraph("new"); embedded = new EmbeddedSection(theFixture, "the label of embedded", "embedded"); treeBuilder.StartEmbeddedSection(embedded, step); }
private IReaderMode buildEmbed(string line) { _hasAdded = true; var first = line.IndexOf(" "); var otherKey = line.Substring(first + 1); var embed = new EmbeddedSection { key = _key, title = _title, fixture = new FixtureModel(otherKey) }; _adder(embed); return(null); }
public void override_title() { var section1 = new EmbeddedSection { key = "Something", title = "Do something", fixture = new FixtureModel("Something") }; var @override = new EmbeddedSection { key = "Something", title = "Do something different", fixture = new FixtureModel("Something") }; section1.ApplyOverrides(@override) .ShouldBeOfType <EmbeddedSection>() .title.ShouldBe(@override.title); }
void IGrammarVisitor.EmbeddedSection(EmbeddedSection section, IStep step) { grammarTag.AddClasses(GrammarConstants.EMBEDDED, GrammarConstants.SECTION) .MetaData(GrammarConstants.LEAF_NAME, section.LeafName) .MetaData(GrammarConstants.FIXTURE, section.Fixture.Name) .MetaData(GrammarConstants.AUTO_SELECT_KEY, section.Fixture.Policies.AutoSelectGrammarKey) .MetaData(GrammarConstants.SELECTION_MODE, section.Fixture.Policies.SelectionMode.ToString()); var area = section.IsTitled() ? new AreaTag(section.Label) : new AreaTag(); var container = area.Container.Add("div").AddClass("section-container"); container.Append(new HolderTag(section.Fixture)); if (section.Fixture.Policies.SelectionMode != SelectionMode.MandatoryAutoSelect) { var selector = new GrammarSelector(section.Fixture).Build(); container.Append(selector); } grammarTag.Append(area); }
void IGrammarVisitor.EmbeddedSection(EmbeddedSection section, IStep step) { add(section.Name, section.Label, Icon.EmbeddedSection); }
private static void writeEmbed(EmbeddedSection grammar, TextWriter writer) { writer.WriteLine($"embeds {grammar.fixture.key}"); }
void ITestStream.EndEmbeddedSection(EmbeddedSection section, IStep step) { _fixtureStack.Pop(); }
void ITestStream.StartEmbeddedSection(EmbeddedSection section, IStep step) { markGrammar(section.Name); ForFixture(section.Fixture.Name).Mark(_currentTest); _fixtureStack.Push(section.Fixture); }
void IGrammarVisitor.EmbeddedSection(EmbeddedSection section, IStep step) { _link.Label(section.Label); }
public void EndEmbeddedSection(EmbeddedSection section, IStep step) { _nodes.Pop(); }
void ITestStream.EndEmbeddedSection(EmbeddedSection section, IStep step) { _document.Pop(); }
private IReaderMode buildEmbed(string line) { _hasAdded = true; var first = line.IndexOf(" "); var otherKey = line.Substring(first + 1); var embed = new EmbeddedSection { key = _key, title = _title, fixture = new FixtureModel(otherKey) }; _adder(embed); return null; }
void ITestStream.StartEmbeddedSection(EmbeddedSection section, IStep step) { _document.Push(new EmbeddedSectionTag(section, step)); }