AddStructure() public method

public AddStructure ( string grammarKey, GrammarStructure structure ) : void
grammarKey string
structure GrammarStructure
return void
        public void combines_the_list_of_all_errors()
        {
            var graph = new FixtureGraph("Math");
            graph.AddStructure("key1", new StubGrammarStructure().AddError("error1"));
            graph.AddStructure("key2", new StubGrammarStructure().AddError("error1").AddError("error 2"));

            graph.AllErrors().Count().ShouldEqual(3);
        }
Beispiel #2
0
        public FixtureGraph BuildTopLevelGraph()
        {
            var fixture = new FixtureGraph("Test");

            fixture.Policies.SelectionMode  = SelectionMode.OneOrMore;
            fixture.Policies.AddGrammarText = "Add Section";

            _fixtures.Where(x => !x.Policies.IsPrivate).Each(x =>
            {
                var grammar   = new EmbeddedSection(x, x.Label ?? x.Name, x.Name);
                grammar.Style = EmbedStyle.TitledAndIndented;
                fixture.AddStructure(x.Name, grammar);
            });

            return(fixture);
        }
        public FixtureGraph BuildTopLevelGraph()
        {
            var fixture = new FixtureGraph("Test");
            fixture.Policies.SelectionMode = SelectionMode.OneOrMore;
            fixture.Policies.AddGrammarText = "Add Section";

            _fixtures.Where(x => !x.Policies.IsPrivate).Each(x =>
            {
                var grammar = new EmbeddedSection(x, x.Label ?? x.Name, x.Name);
                grammar.Style = EmbedStyle.TitledAndIndented;
                fixture.AddStructure(x.Name, grammar);
            });

            return fixture;
        }
        public void SetUp()
        {
            fixture = new FixtureGraph();
            fixture.AddStructure("Hidden1", new Sentence());
            fixture.AddStructure("Hidden2", new Sentence());
            fixture.AddStructure("NotHidden3", new Sentence());
            fixture.AddStructure("NotHidden4", new Sentence());

            var constraints = new Policies();
            constraints.HideGrammar("Hidden1");
            constraints.HideGrammar("Hidden2");

            fixture.Policies = constraints;
        }
        public void SetUp()
        {
            graph = new FixtureGraph("something");
            structure = new StubGrammarStructure();

            graph.AddStructure("grammar1", structure);
        }
Beispiel #6
0
        private void readGrammar(IGrammar grammar, FixtureGraph fixtureGraph, string key)
        {
            GrammarStructure structure = grammar.ToStructure(_library);
            structure.Description = grammar.Description;

            fixtureGraph.AddStructure(key, structure);
        }