public ConfigureObjectGrammar <T, CELL> Configure(Action <T, CELL> configure)
            {
                var grammar = new ConfigureObjectGrammar <T, CELL>(_name, configure);

                _parent._grammar.AddGrammar(grammar);

                return(grammar);
            }
Beispiel #2
0
        public void SetUp()
        {
            grammar1 = new ConfigureObjectGrammar <ConfiguredObject, int>("age", (o, age) => o.Age = age);
            grammar2 = new ConfigureObjectGrammar <ConfiguredObject, string>("name", (o, name) => o.Name = name);
            grammar2.DefaultValue = "Han Solo";

            context = new TestContext();
            target  = new ConfiguredObject();

            context.CurrentObject = target;
        }
        public void SetUp()
        {
            grammar1 = new ConfigureObjectGrammar<ConfiguredObject, int>("age", (o, age) => o.Age = age);
            grammar2 = new ConfigureObjectGrammar<ConfiguredObject, string>("name", (o, name) => o.Name = name);
            grammar2.DefaultValue = "Han Solo";

            context = new TestContext();
            target = new ConfiguredObject();

            context.CurrentObject = target;
        }
        public ConfigureObjectFixture()
        {
            var grammar = new ConfigureObjectGrammar <Address, string>("the data is {data}", (a, data) =>
            {
                var values        = data.Split('-');
                a.City            = values.First();
                a.StateOrProvince = values.Last();
            });

            grammar.CellModifications.DefaultValue("Austin-Texas");

            this["SetProps"] = grammar;
        }
        public ConfigureObjectFixture()
        {
            var grammar = new ConfigureObjectGrammar<Address, string>("the data is {data}", (a, data) =>
            {
                var values = data.Split('-');
                a.City = values.First();
                a.StateOrProvince = values.Last();
            });

            grammar.CellModifications.DefaultValue("Austin-Texas");

            this["SetProps"] = grammar;
        }