public TestEditorTag(FixtureLibrary library) : base("div") { AddClass("main"); Add("h2").AddClass(HtmlClasses.TEST_NAME); Id("testEditor"); AddClass(HtmlClasses.TEST_EDITOR); _container = Add("div").AddClasses("container", HtmlClasses.SECTION, "test-editor"); FixtureGraph fixture = library.BuildTopLevelGraph(); HtmlTag holder = new HolderTag(fixture).AddClass("top-level-holder"); holder.Children.Last().Render(false); Container .MetaData(GrammarConstants.LEAF_NAME, GrammarConstants.TEST) .MetaData(GrammarConstants.FIXTURE, GrammarConstants.TEST) .MetaData(GrammarConstants.SELECTION_MODE, SelectionMode.OneOrMore.ToString()) .Append(holder) .Append(new HtmlTag("hr")); Container.ActionLink(fixture.Policies.AddGrammarText, GrammarConstants.ADD_SECTION_ACTIVATOR); Container.Append(new GrammarSelector(fixture).Build()); }
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>(); }
public HtmlTag Build() { _top = new DivTag(GrammarConstants.FIXTURE_SELECTOR).Hide(); FixtureGraph topFixture = _library.BuildTopLevelGraph(); var topFixtureNode = writeFixture(topFixture); topFixtureNode.Children.Each(x => x.AddClass("top-node")); _library.ActiveFixtures.Each(f => writeFixture(f)); return(_top); }