public void adding_a_close_link_adds_to_the_header_tag_if_it_exists() { var sentence = new Sentence { Name = "ThisGrammar", Parent = new FixtureGraph() }; var tag = new GrammarTag(sentence); var header = new HeaderTag(); tag.Append(header); tag.AddDeleteLink(); tag.Children.Count.ShouldEqual(1); Debug.WriteLine(tag.ToString()); header.FirstChild().Children.Count(x => x is RemoveLinkTag).ShouldEqual(1); }
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 header = new HeaderTag(); if (section.IsTitled()) { header.Titled(section.Title); } grammarTag.Child(header); grammarTag.Child(new HolderTag(section.Fixture)); if (section.Fixture.Policies.SelectionMode == SelectionMode.MandatoryAutoSelect) return; HtmlTag selector = new GrammarSelector(section.Fixture).Build(); grammarTag.Child(selector); }
void IGrammarVisitor.Paragraph(Paragraph paragraph, IStep step) { grammarTag.AddClasses(GrammarConstants.PARAGRAPH, paragraph.Style.ToString()); var header = new HeaderTag(); grammarTag.Child(header); if (paragraph.Style == EmbedStyle.TitledAndIndented) { header.Titled(paragraph.Title); } paragraph.ForEachGrammar(g => { var tag = new GrammarTag(g); grammarTag.Child(tag); _grammarTags.Do(tag, () => g.AcceptVisitor(this, new Step())); }); }