Exemplo n.º 1
0
        protected override void configureDocumentsAre(ObjectConstructionExpression <Target> _)
        {
            _.WithInput <string>("Name").Configure((target, name) =>
            {
                IdToName[target.Id] = name;
            }).Header("Document Name");

            _.SetProperty(x => x.Number).DefaultValue("1");
            _.SetProperty(x => x.Long).DefaultValue("1");
            _.SetProperty(x => x.String).DefaultValue("Max");
            _.SetProperty(x => x.Flag).DefaultValue("false");
            _.SetProperty(x => x.Double).DefaultValue("1");
            _.SetProperty(x => x.Decimal).DefaultValue("1");
            _.SetProperty(x => x.Date).DefaultValue("TODAY");

            _.WithInput <bool>("InnerFlag").Configure((target, flag) =>
            {
                if (target.Inner == null)
                {
                    target.Inner = new Target();
                }

                target.Inner.Flag = flag;
            });
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Use to create a new paragraph grammar to configure an object stored on
        ///     the Context.State.CurrentObject with property
        ///     setter children grammars
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="title"></param>
        /// <param name="action"></param>
        /// <returns></returns>
        public static ParagraphGrammar CreateObject <T>(string title, Action <ObjectConstructionExpression <T> > action)
        {
            var grammar    = new ParagraphGrammar(title);
            var expression = new ObjectConstructionExpression <T>(grammar);

            action(expression);

            return(grammar);
        }
Exemplo n.º 3
0
        public void SetUp()
        {
            _theAddress = null;

            grammar    = new ParagraphGrammar();
            expression = new ObjectConstructionExpression <Address>(grammar);

            theStep = new Step();
        }
        public void SetUp()
        {
            _theAddress = null;

            grammar = new ParagraphGrammar();
            expression = new ObjectConstructionExpression<Address>(grammar);

            theStep = new Step();
        }
Exemplo n.º 5
0
        public static ParagraphGrammar CreateNewObject <T>(Action <ObjectConstructionExpression <T> > action)
            where T : new()
        {
            var grammar    = new ParagraphGrammar(CreateNewObject <T>());
            var expression = new ObjectConstructionExpression <T>(grammar);

            action(expression);


            return(grammar);
        }
Exemplo n.º 6
0
        protected override void configureDocumentsAre(ObjectConstructionExpression <Target> _)
        {
            _.WithInput <string>("Name").Configure((target, name) =>
            {
                IdToName[target.Id] = name;
            }).Header("Document Name");

            _.SetProperty(x => x.Number).DefaultValue("1");
            _.SetProperty(x => x.Long).DefaultValue("1");
            _.SetProperty(x => x.String).DefaultValue("Max");
        }
Exemplo n.º 7
0
 protected virtual void configureDocumentsAre(ObjectConstructionExpression <Target> _)
 {
     // do nothing
 }
Exemplo n.º 8
0
        public void SetPropertiesOnCurrentObject <T>(Action <ObjectConstructionExpression <T> > action)
        {
            var expression = new ObjectConstructionExpression <T>(_grammar);

            action(expression);
        }