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; }); }
/// <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); }
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(); }
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); }
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"); }
protected virtual void configureDocumentsAre(ObjectConstructionExpression <Target> _) { // do nothing }
public void SetPropertiesOnCurrentObject <T>(Action <ObjectConstructionExpression <T> > action) { var expression = new ObjectConstructionExpression <T>(_grammar); action(expression); }