public static CellTag AddCell(this ICellBuilder builder, GrammarTag grammar, Cell cell) { CellTag tag = grammar.AddCell(cell, builder.TagName); builder.Configure(cell, tag); return tag; }
public void SetUp() { grammarTag = new GrammarTag(new Sentence { Name = "Math" }); }
public static CellTag AddCell(this ICellBuilder builder, GrammarTag grammar, Cell cell) { CellTag tag = grammar.AddCell(cell, builder.TagName); builder.Configure(cell, tag); return(tag); }
public GrammarTag Add(GrammarStructure structure) { var childGrammarTag = new GrammarTag(structure); Append(childGrammarTag); _fixture.Policies.Tags(structure.Name).Each(tag => childGrammarTag.AddSafeClassName(tag)); return childGrammarTag; }
public void SetUp() { FixtureLibrary library = FixtureLibrary.For(x => x.AddFixture<SentenceTargetFixture>()); grammarTag = new GrammarTag(library.FixtureFor(typeof(SentenceTargetFixture).GetFixtureAlias()).GrammarFor("Go")); var writer = new SentenceWriter(grammarTag, new CellBuilderLibrary()); writer.Write(); }
public GrammarTag Add(GrammarStructure structure) { var grammarTag = new GrammarTag(structure); Child(grammarTag); _fixture.Policies.Tags(structure.Name).Each(tag => grammarTag.AddSafeClassName(tag)); return grammarTag; }
public GrammarTag Add(GrammarStructure structure) { var childGrammarTag = new GrammarTag(structure); Append(childGrammarTag); _fixture.Policies.Tags(structure.Name).Each(tag => childGrammarTag.AddSafeClassName(tag)); return(childGrammarTag); }
public void has_the_step_class() { var sentence = new Sentence { Name = "ThisGrammar", }; var tag = new GrammarTag(sentence); tag.HasClass(GrammarConstants.STEP).ShouldBeTrue(); }
public void has_the_meta_data_tag_for_key() { var sentence = new Sentence { Name = "ThisGrammar", }; var tag = new GrammarTag(sentence); tag.MetaData(GrammarConstants.KEY).ShouldEqual(sentence.Name); }
public void adding_a_close_link_adds_to_itself_if_there_is_no_header_tag() { var sentence = new Sentence { Name = "ThisGrammar", Parent = new FixtureGraph() }; var tag = new GrammarTag(sentence); tag.AddDeleteLink(); tag.Children.Last().ShouldBeOfType<RemoveLinkTag>(); }
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.Paragraph(Paragraph paragraph, IStep step) { grammarTag.AddClasses(GrammarConstants.PARAGRAPH, paragraph.Style.ToString()); var area = new AreaTag(paragraph.Label); var container = area.Container.Add("div") .AddClass("paragraph.Style.ToString()") .AddClass("section-container") .AddClass("in-paragraph"); grammarTag.Append(area); paragraph.ForEachGrammar(g => { var tag = new GrammarTag(g); container.Append(tag); _grammarTags.Do(tag, () => g.AcceptVisitor(this, new Step())); }); }
public void SetUp() { var grammarTag = new GrammarTag(new Sentence { Name = "Math" }); Cell cell = Cell.For<string>("name"); cell.SelectionValues = new List<string> { "Jeremy", "Josh", "Chad" }; var writer = new SentenceWriter(grammarTag, new CellBuilderLibrary()); writer.Input(new TextInput(cell)); select = grammarTag.Children.First(); }
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())); }); }
public void read_the_name_and_description() { var sentence = new Sentence { Name = "ThisGrammar", }; var tag = new GrammarTag(sentence); tag.TagName().ShouldEqual("div"); tag.HasClass(sentence.Name).ShouldBeTrue(); }
private void writeGrammar(GrammarStructure grammar) { GrammarTag tag = Add(grammar); _grammarTags.Do(tag, () => grammar.AcceptVisitor(this, new Step())); }
public void AddCell(GrammarTag tag, Cell cell) { _builders.First(x => x.CanBuild(cell)).AddCell(tag, cell); }
public void SetUp() { sentence = new Sentence { Name = "Something" }; var fixture = new FixtureStructure("Math"); fixture.Policies.Tag(sentence.Name, "abc"); fixture.Policies.Tag(sentence.Name, "def"); fixture.Policies.Tag(Guid.NewGuid().ToString(), "tuv"); fixtureTag = new FixtureTag(fixture); grammarTag = fixtureTag.Add(sentence); }
public void SetUp() { builder = new TextboxBuilder(); grammar = new GrammarTag(new Sentence()); }
public SentenceWriter(GrammarTag grammar, ICellBuilderLibrary builders) { _grammar = grammar; _builders = builders; }
public void SetUp() { tag = null; grammarTag = new GrammarTag(new Sentence { Name = "Math" }); cell = new Cell("name", typeof(string)); writer = new SentenceWriter(grammarTag, new CellBuilderLibrary()); }