Esempio n. 1
0
 public void Record(Dec.Recorder recorder)
 {
     recorder
     .WithFactory(new Dictionary <Type, Func <Type, object> >()
     {
         { typeof(Factoried), _ => null }
     })
     .Record(ref element, "element");
 }
Esempio n. 2
0
 public void Record(Dec.Recorder recorder)
 {
     recorder
     .WithFactory(new Dictionary <Type, Func <Type, object> >()
     {
         { typeof(FactoriedDerived), _ => new FactoriedDerived()
           {
               value = 1
           } }
     })
     .Record(ref one, "one");
 }
Esempio n. 3
0
 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");
 }
Esempio n. 4
0
 public void Record(Dec.Recorder recorder)
 {
     recorder
     .WithFactory(new Dictionary <Type, Func <Type, object> >()
     {
         { typeof(Recursive), _ => new Recursive()
           {
               value = 42
           } }
     })
     .Record(ref element, "element");
 }
Esempio n. 5
0
            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");
            }
Esempio n. 6
0
            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");
            }
Esempio n. 7
0
            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");
            }
Esempio n. 8
0
            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");
                }
            }
Esempio n. 9
0
            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");
            }