public void Record(Dec.Recorder recorder) { recorder .WithFactory(new Dictionary <Type, Func <Type, object> >() { { typeof(Factoried), _ => null } }) .Record(ref element, "element"); }
public void Record(Dec.Recorder recorder) { recorder .WithFactory(new Dictionary <Type, Func <Type, object> >() { { typeof(FactoriedDerived), _ => new FactoriedDerived() { value = 1 } } }) .Record(ref one, "one"); }
public void Record(Dec.Recorder recorder) { recorder .WithFactory(new Dictionary <Type, Func <Type, object> >() { { typeof(SelectiveLeaf), _ => new SelectiveLeaf() { factory = 12, factoryrecord = 14 } } }) .Record(ref element, "element"); }
public void Record(Dec.Recorder recorder) { recorder .WithFactory(new Dictionary <Type, Func <Type, object> >() { { typeof(Recursive), _ => new Recursive() { value = 42 } } }) .Record(ref element, "element"); }
public void Record(Dec.Recorder recorder) { var parameters = recorder.WithFactory(new Dictionary <Type, Func <Type, object> >() { { typeof(RecorderHybrid), _ => new RecorderHybrid() { nonrecorded = 100, recorded = 200 } }, }); parameters.Record(ref one, "one"); parameters.Record(ref two, "two"); }
public void Record(Dec.Recorder recorder) { var parameters = recorder .WithFactory(new Dictionary <Type, Func <Type, object> >() { { typeof(Factoried), _ => new Factoried() { value = 42 } } }); parameters.Record(ref one, "one"); parameters.Record(ref two, "two"); }
public void Record(Dec.Recorder recorder) { Type proposed = provided_setting == InheritanceTestFactoryProvided.Exact ? typeof(FactoriedDerived) : typeof(Factoried); recorder .WithFactory(new Dictionary <Type, Func <Type, object> >() { { proposed, _ => { if (result_setting == InheritanceTestResult.Exact) { return(new FactoriedDerived() { value = 42 }); } else if (result_setting == InheritanceTestResult.Derived) { return(new FactoriedDerivedDouble() { value = 42 }); } else if (result_setting == InheritanceTestResult.ParentError) { return(new Factoried() { value = 42 }); } else if (result_setting == InheritanceTestResult.SiblingError) { return(new FactoriedDerivedSibling() { value = 42 }); } else if (result_setting == InheritanceTestResult.InvalidError) { return("42"); } return(null); } } }) .Record(ref element, "element"); }
public void Record(Dec.Recorder recorder) { recorder.Record(ref makeFactory, "makeFactory"); if (makeFactory) { recorder.WithFactory(new Dictionary <Type, Func <Type, object> >() { { typeof(RecursiveListKillerItem), _ => new RecursiveListKillerItem() { usedFactory = true } }, }).Record(ref element, "element"); } else { recorder.Record(ref element, "element"); } }
public void Record(Dec.Recorder recorder) { var factory = recorder.WithFactory(new Dictionary <Type, Func <Type, object> >() { { typeof(Factoried), _ => new Factoried() { value = 5 } }, { typeof(FactoriedDerived), _ => new FactoriedDerived() { value = 10 } }, { typeof(FactoriedDerivedDouble), _ => new FactoriedDerivedDouble() { value = 15 } }, { typeof(string), _ => "" }, }); factory.Record(ref norm, "norm"); factory.Record(ref derived, "derived"); factory.Record(ref deriveddouble, "deriveddouble"); }