public static T NewObject <T>() { var config = new FakeUpConfig <T>(); var instance = (T)NewObject(typeof(T), new ObjectCreationContext <T>(config)); return(instance); }
internal ObjectCreationContext(FakeUpConfig <TFakeObject> config) { this.Config = config; this.StatesRepository = this.Config.StatesConfig.GetRepository(); this.InvocationStack = new Stack <PropertyInfo>(); this.Evaluators = config.ValueEvaluators.Concat(this.DefaultValueEvaluators).ToArray(); }
private static FakeUpConfig <T> GetConfig <T>(Action <IFakeUpConfig <T> > action) { var opt = new FakeUpConfig <T>(); action?.Invoke(opt); return(opt); }
public WithAbsoluteCollectionPath(Expression <Func <TFakeObject, TCollection> > memberPath, FakeUpConfig <TFakeObject> config) { this.memberPath = memberPath; this.config = config; }
public WithAbsolutePath(FakeUpConfig <TFakeObject> config, Expression <Func <TFakeObject, TMember> > memberPath) { this.config = config; this.memberPath = memberPath; }
public WithType(FakeUpConfig <TFakeObject> config) { this.config = config; }
public WithCollectionType(FakeUpConfig <TFakeObject> config) { this.config = config; }
public WithRelativePath(FakeUpConfig <TFakeObject> config, Expression <Func <TMember, TMetaMember> > memberExpr) { this.config = config; this.memberExpr = memberExpr; }