Commits

Anonymous committed 7b9d5b5

make Resolve able to be called multiple time

  • Participants
  • Parent commits f0af92d

Comments (0)

Files changed (2)

File Usually/Resolve.cs

         {
             this.generator = @generator;
         }
+        public Func<string, object> Generator 
+        { 
+            get { return this.generator; }
+            set { this.generator = value; }
+        }
         public ResolverItem<T> Add<T>(Meta<T> meta, IEnumerable<T> olds, IEnumerable<T> news) 
         {
             var r = new ResolverItem<T>(this, meta, olds, news);
         IEnumerable<TransactionRecord> ResolveForMasterInsert(object[] refKey, object[] actualKey);
         IEnumerable<TransactionRecord> ResolveForMasterStatic(object[] refKey);
         IEnumerable<TransactionRecord> ResolveForMasterDelete(object[] refKey);
+        void Reset();
     }
     public class ResolverItem<T> : IResolverItem 
     {
         protected void SetActualMasterKey(TransactionRecord t, object[] actualKey)
         {
             IDictionary<string, object> dict = null;
-            if (t is InsertRecord) dict = (t as InsertRecord).Values;
-            if (t is UpdateRecord) dict = (t as InsertRecord).Values;
+            if (t is InsertRecord) dict = ((InsertRecord)t).Values;
+            if (t is UpdateRecord) dict = ((UpdateRecord)t).Values;
             if (dict == null) throw new Exception("Unexpect type: " + t.GetType().Name);
             this.info.SetActualMasterKey(dict, actualKey);
         }
                 foreach (var t in records) yield return t;
             }
         }
+        IEnumerable<TransactionRecord> IResolverItem.ResolveForRoot()
+        {
+            ((IResolverItem)this).Reset();
+            var r = new SameTypeReconciler<T>(this.info, this.olds, this.news);
+            foreach (var j in r.ReconcileNonDelete())
+            {
+                if (j.Record is InsertRecord)
+                    foreach (var t in this.ResolveForInsert(j))
+                        yield return t;
+                else
+                    foreach (var t in this.ResolveForStatic(j))
+                        yield return t;
+            }
+            foreach (var j in r.ReconcileDelete())
+            {
+                foreach (var t in this.ResolveForDelete(j))
+                    yield return t;
+            }
+        }
+        void IResolverItem.Reset()
+        {
+            this._journals = null;
+            foreach (var i in this.items) i.Reset();
+        }
         protected IEnumerable<TransactionRecord> ResolveForInsert(TransactionJournal<T, T> j)
         {
             var ins = (InsertRecord)j.Record;
             }
             yield return j.Record;
         }
-        IEnumerable<TransactionRecord> IResolverItem.ResolveForRoot()
-        {
-            var r = new SameTypeReconciler<T>(this.info, this.olds, this.news);
-            foreach (var j in r.ReconcileNonDelete())
-            {
-                if (j.Record is InsertRecord)
-                    foreach (var t in this.ResolveForInsert(j))
-                        yield return t;
-                else
-                    foreach (var t in this.ResolveForStatic(j))
-                        yield return t;
-            }
-            foreach (var j in r.ReconcileDelete())
-            {
-                foreach (var t in this.ResolveForDelete(j))
-                    yield return t;
-            }
-        }
     }
     public class GenericItemList<T> where T : class
     {
         }
         public string TableName
         {
-            get { return (this.info as IMetaInfo<object[]>).TableName; }
+            get { return ((IMetaInfo<object[]>)this.info).TableName; }
         }
         public IMetaInfo<object[]> Info
         {
         public void Load(IEnumerable<T> source)
         {
             this.Clear();
-            foreach (var i in @source) this.Add(i as T);
+            foreach (var i in @source) this.Add((T)i);
             this.source = @source;
         }
         public void Load(Func<string, IEnumerable<object>> data)
             string TableName { get; }
             string Group { get; }
             void Load(Func<string, IEnumerable<object>> data);
+            void Reset();
             IEnumerable<TransactionRecord> ResolveForRoot();
             IEnumerable<TransactionRecord> ResolveForMasterInsert(object[] refKey, object[] actualKey);
             IEnumerable<TransactionRecord> ResolveForMasterStatic(object[] refKey);
             {
                 get { return this.info.MasterKeyGroup; }
             }
-            public SettlerItem<TT> Add<TT>(Meta<TT> meta) where TT: class
+            void ISettlerItem.Reset()
+            {
+                this._journals = null;
+                foreach (var i in this.items) i.Reset();
+            }
+            public SettlerItem<TT> Add<TT>(Meta<TT> meta) where TT : class
             {
                 var r = new SettlerItem<TT>(this.host, meta);
-                this.host.CheckBeforeAdd((r as ISettlerItem).TableName);
+                this.host.CheckBeforeAdd(((ISettlerItem)r).TableName);
                 this.items.Add(r);
                 return r;
             }
             protected void SetActualMasterKey(TransactionRecord t, object[] actualKey)
             {
                 IDictionary<string, object> dict = null;
-                if (t is InsertRecord) dict = (t as InsertRecord).Values;
-                if (t is UpdateRecord) dict = (t as InsertRecord).Values;
+                if (t is InsertRecord) dict = ((InsertRecord) t).Values;
+                if (t is UpdateRecord) dict = ((UpdateRecord) t).Values;
                 if (dict == null) throw new Exception("Unexpect type: " + t.GetType().Name);
                 this.info.SetActualMasterKey(dict, actualKey);
             }
             }
             IEnumerable<TransactionRecord> ISettlerItem.ResolveForRoot()
             {
+                ((ISettlerItem)this).Reset();
                 var r = this.list.newReconciler();
                 foreach (var j in r.ReconcileNonDelete())
                 {
         private Func<string, object> generator = null;
         private IList<string> tables = new List<string>();
         private IList<ISettlerItem> roots = new List<ISettlerItem>();
-        public Settler(Func<string, object> generator)
+        public Settler(Func<string, object> generator = null)
         {
             this.generator = generator;
         }
+        public Func<string, object> Generator 
+        { 
+            get { return this.generator; }
+            set { this.generator = value; }
+        }
         void CheckBeforeAdd(string name)
         {
             if (this.tables.Contains(name)) throw new Exception("Duplicate item: " + name);
         public SettlerItem<T> Add<T>(Meta<T> meta) where T: class
         {
             var r = new SettlerItem<T>(this, meta);
-            this.CheckBeforeAdd((r as ISettlerItem).TableName);
+            this.CheckBeforeAdd(((ISettlerItem)r).TableName);
             this.roots.Add(r);
             return r;
         }

File UsuallyTests/TestResolve.cs

         public static void Meta(IMetaBuilder<Order> m)
         {
             m.Table("ORDERS");
-            m.IntegerKey("ORDER_ID", (x) => x.OrderId, "SEQ_ORDERS");
-            m.Value("ORDER_NUMBER", (x) => x.OrderNumber);
-            m.Value("CUSTOMER_ID", (x) => x.CustomerId);
-            m.Value("ORDER_DATE", (x) => x.OrderDate);
-            m.Value("STATUS", (x) => x.Status);
+            m.IntegerKey("ORDER_ID", x => x.OrderId, "SEQ_ORDERS");
+            m.Value("ORDER_NUMBER", x => x.OrderNumber);
+            m.Value("CUSTOMER_ID", x => x.CustomerId);
+            m.Value("ORDER_DATE", x => x.OrderDate);
+            m.Value("STATUS", x => x.Status);
         }
     }
     [Serializable]
         public static void Meta(IMetaBuilder<OrderLine> m)
         {
             m.Table("ORDER_LINES");
-            m.IntegerKey("LINE_ID", (x) => x.LineId, "SEQ_ORDER_LINES");
-            m.ExtraDecimalKey("x", "LINE_UNIQUE_ID", (x) => x.UniqueId, "SEQ_ORDER_LINES_UNQ");
-            m.Ref("ORDER_ID", (x) => x.OrderId);
-            m.Value("ITEM_ID", (x) => x.ItemId);
-            m.Value("ITEM_NAME", (x) => x.ItemName);
-            m.Value("QUANTITY", (x) => x.Quantity);
-            m.Value("UNIT", (x) => x.Unit);
+            m.IntegerKey("LINE_ID", x => x.LineId, "SEQ_ORDER_LINES");
+            m.ExtraDecimalKey("x", "LINE_UNIQUE_ID", x => x.UniqueId, "SEQ_ORDER_LINES_UNQ");
+            m.Ref("ORDER_ID", x => x.OrderId);
+            m.Value("ITEM_ID", x => x.ItemId);
+            m.Value("ITEM_NAME", x => x.ItemName);
+            m.Value("QUANTITY", x => x.Quantity);
+            m.Value("UNIT", x => x.Unit);
         }
     }
     [Serializable]
         public static void Meta(IMetaBuilder<Shipment> m)
         {
             m.Table("ORDER_SHIPMENTS");
-            m.IntegerKey("SHIPMENT_ID", (x) => x.ShipmentId, "SEQ_ORDER_SHIPMENTS");
-            m.Ref("ORDER_LINE_ID", (x) => x.OrderLineId);
-            m.Value("QUANTITY", (x) => x.Quantity);
-            m.Value("SHIP_DATE", (x) => x.ShipDate);
+            m.IntegerKey("SHIPMENT_ID", x => x.ShipmentId, "SEQ_ORDER_SHIPMENTS");
+            m.Ref("ORDER_LINE_ID", x => x.OrderLineId);
+            m.Value("QUANTITY", x => x.Quantity);
+            m.Value("SHIP_DATE", x => x.ShipDate);
         }
     }
 
         public static Func<string, object> CreateGenerator()
         {
             var nextIds = new Dictionary<string, int>();
-            return (n) =>
+            return n =>
             {
                 int i = 0;
                 if (!nextIds.TryGetValue(n, out i))
             var changes = Resolver.Resolve(OrderLine.Meta, olds, news).ToList();
             Assert.AreEqual(8, changes.Count);
             var e = changes.GetEnumerator() as IEnumerator<TransactionRecord>;
-            AssertNextInsert(e, "ORDER_LINES", (d) =>
+            AssertNextInsert(e, "ORDER_LINES", d =>
             {
                 d["LINE_ID"] = 11;
                 d["LINE_UNIQUE_ID"] = 800;
                 d["QUANTITY"] = 2;
                 d["UNIT"] = null;
             });
-            AssertNextUpdate(e, "ORDER_LINES", "LINE_ID", 2, (d) =>
+            AssertNextUpdate(e, "ORDER_LINES", "LINE_ID", 2, d =>
             {
                 d["ITEM_ID"] = 2002;
                 d["ITEM_NAME"] = "Two Oo Oo Two";
             });
-            AssertNextUpdate(e, "ORDER_LINES", "LINE_ID", 5, (d) =>
+            AssertNextUpdate(e, "ORDER_LINES", "LINE_ID", 5, d =>
             {
                 d["QUANTITY"] = null;
             });
-            AssertNextUpdate(e, "ORDER_LINES", "LINE_ID", 7, (d) =>
+            AssertNextUpdate(e, "ORDER_LINES", "LINE_ID", 7, d =>
             {
                 d["UNIT"] = "Gallon";
             });
-            AssertNextInsert(e, "ORDER_LINES", (d) =>
+            AssertNextInsert(e, "ORDER_LINES", d =>
             {
                 d["LINE_ID"] = -1;
                 d["LINE_UNIQUE_ID"] = 900;
                 d["QUANTITY"] = 8;
                 d["UNIT"] = "Piece";
             });
-            AssertNextInsert(e, "ORDER_LINES", (d) =>
+            AssertNextInsert(e, "ORDER_LINES", d =>
             {
                 d["LINE_ID"] = 9;
                 d["LINE_UNIQUE_ID"] = -7;
             var changes = r.Resolve().ToList();
             Assert.AreEqual(8, changes.Count);
             var e = changes.GetEnumerator() as IEnumerator<TransactionRecord>;
-            AssertNextInsert(e, "ORDER_LINES", (d) =>
+            AssertNextInsert(e, "ORDER_LINES", d =>
             {
                 d["LINE_ID"] = 11;
                 d["LINE_UNIQUE_ID"] = 800;
                 d["QUANTITY"] = 2;
                 d["UNIT"] = null;
             });
-            AssertNextUpdate(e, "ORDER_LINES", "LINE_ID", 2, (d) =>
+            AssertNextUpdate(e, "ORDER_LINES", "LINE_ID", 2, d =>
             {
                 d["ITEM_ID"] = 2002;
                 d["ITEM_NAME"] = "Two Oo Oo Two";
             });
-            AssertNextUpdate(e, "ORDER_LINES", "LINE_ID", 5, (d) =>
+            AssertNextUpdate(e, "ORDER_LINES", "LINE_ID", 5, d =>
             {
                 d["QUANTITY"] = null;
             });
-            AssertNextUpdate(e, "ORDER_LINES", "LINE_ID", 7, (d) =>
+            AssertNextUpdate(e, "ORDER_LINES", "LINE_ID", 7, d =>
             {
                 d["UNIT"] = "Gallon";
             });
-            AssertNextInsert(e, "ORDER_LINES", (d) =>
+            AssertNextInsert(e, "ORDER_LINES", d =>
             {
                 d["LINE_ID"] = 1500001;
                 d["LINE_UNIQUE_ID"] = 900;
                 d["QUANTITY"] = 8;
                 d["UNIT"] = "Piece";
             });
-            AssertNextInsert(e, "ORDER_LINES", (d) =>
+            AssertNextInsert(e, "ORDER_LINES", d =>
             {
                 d["LINE_ID"] = 9;
                 d["LINE_UNIQUE_ID"] = 1900001;
             this.oldShips = new List<Shipment>();
             ForMaster(this.oldOrders,
                 new Order { OrderId = 1, OrderNumber = "N-001", OrderDate = new DateTime(2012, 2, 14), Status = "FINISHED", CustomerId = 1 },
-                (o) => 
+                o => 
                 {
                     ForMaster(this.oldLines,
                         new OrderLine { OrderId = o.OrderId, LineId = 101, UniqueId = 1101, ItemId = 900001, ItemName = "One", Quantity = 10, Unit = "U1" },
-                        (ln) => 
+                        ln => 
                         {
                             this.oldShips.AddRange(new Shipment[] 
                             {
                     );
                     ForMaster(this.oldLines,
                         new OrderLine { OrderId = o.OrderId, LineId = 102, UniqueId = 1102, ItemId = 900002, ItemName = "Two", Quantity = 2, Unit = "U2" },
-                        (ln) =>
+                        ln =>
                         {
                             this.oldShips.AddRange(new Shipment[] 
                             {
                     );
                     ForMaster(this.oldLines,
                         new OrderLine { OrderId = o.OrderId, LineId = 103, UniqueId = 1103, ItemId = 900003, ItemName = "Three", Quantity = 2, Unit = "U3" },
-                        (ln) =>
+                        ln =>
                         {
                             this.oldShips.AddRange(new Shipment[] 
                             {
             );
             ForMaster(this.oldOrders,
                 new Order { OrderId = 2, OrderNumber = "N-002", OrderDate = new DateTime(2012, 2, 19), Status = "ACTIVE", CustomerId = 2 },
-                (o) =>
+                o =>
                 {
                     ForMaster(this.oldLines,
                         new OrderLine { OrderId = o.OrderId, LineId = 201, UniqueId = 2201, ItemId = 900001, ItemName = "One", Quantity = 1, Unit = "U1" },
-                        (ln) =>
+                        ln =>
                         {
                             this.oldShips.AddRange(new Shipment[] 
                             {
                     );
                     ForMaster(this.oldLines,
                         new OrderLine { OrderId = o.OrderId, LineId = 202, UniqueId = 2202, ItemId = 900002, ItemName = "Two", Quantity = 2, Unit = "U2" },
-                        (ln) =>
+                        ln =>
                         {
                             this.oldShips.AddRange(new Shipment[] 
                             {
             );
             ForMaster(this.oldOrders,
                 new Order { OrderId = 3, OrderNumber = "N-003", OrderDate = new DateTime(2012, 3, 2), Status = "INCOMPLETED", CustomerId = 3 },
-                (o) => 
+                o => 
                 {
                     ForMaster(this.oldLines,
                         new OrderLine { OrderId = o.OrderId, LineId = 301, UniqueId = 3301, ItemId = 900001, ItemName = "One", Quantity = 1, Unit = "U1" },
-                        (ln) => 
+                        ln => 
                         {
                         }
                     );
         }
         private void DoChange()
         {
-            this.newShips.RemoveAll((x) => x.ShipmentId == 10201);   // 1 deleted
-            this.newShips.RemoveAll((x) => x.ShipmentId == 10303);   // 1 deleted
-            this.newShips.RemoveAll((x) => x.ShipmentId == 20102);   // 1 deleted
-            this.newLines.RemoveAll((x) => x.LineId == 202);         // 3 deleted
-            this.newOrders.RemoveAll((x) => x.OrderId == 3);         // 2 deleted
+            this.newShips.RemoveAll(x => x.ShipmentId == 10201);   // 1 deleted
+            this.newShips.RemoveAll(x => x.ShipmentId == 10303);   // 1 deleted
+            this.newShips.RemoveAll(x => x.ShipmentId == 20102);   // 1 deleted
+            this.newLines.RemoveAll(x => x.LineId == 202);         // 3 deleted
+            this.newOrders.RemoveAll(x => x.OrderId == 3);         // 2 deleted
             ForMaster(                                               // 9 inserted
                 this.newOrders,
                 new Order() { OrderId = -4, OrderNumber = "N-004", OrderDate = new DateTime(2012, 3, 5), Status = "ACTIVE", CustomerId = 4 },
-                (o) =>
+                o =>
                 {
                     ForMaster(this.newLines,
                         new OrderLine { OrderId = o.OrderId, LineId = -401, UniqueId = -4401, ItemId = 900001, ItemName = "One", Quantity = 10, Unit = "U1" },
-                        (ln) =>
+                        ln =>
                         {
                             this.newShips.AddRange(new Shipment[] 
                             {
                     );
                     ForMaster(this.newLines,
                         new OrderLine { OrderId = o.OrderId, LineId = -402, UniqueId = -4402, ItemId = 900002, ItemName = "Two", Quantity = 2, Unit = "U2" },
-                        (ln) =>
+                        ln =>
                         {
                             this.newShips.AddRange(new Shipment[] 
                             {
                     );
                 }
             );
-            this.newLines.Single((o) => o.LineId == 102).OrderId = 3;                             // 2 deleted (shipment 10201 already deleted)
-            this.newOrders.Single((o) => o.OrderId == 1).Status = "ARCHIVED";                     // 1 updated
+            this.newLines.Single(o => o.LineId == 102).OrderId = 3;                             // 2 deleted (shipment 10201 already deleted)
+            this.newOrders.Single(o => o.OrderId == 1).Status = "ARCHIVED";                     // 1 updated
             foreach (var ln in (from ln in this.newLines where ln.OrderId == 2 select ln))        // 1 updated
                 ln.Quantity = 12345;
             foreach (var sh in (from sh in this.newShips where sh.OrderLineId == 103 select sh))  // 3 updated
         {
             Assert.AreEqual(24, changes.Count);
             var e = changes.GetEnumerator() as IEnumerator<TransactionRecord>;
-            AssertNextUpdate(e, "ORDERS", "ORDER_ID", 1, (d) =>
+            AssertNextUpdate(e, "ORDERS", "ORDER_ID", 1, d =>
             {
                 d["STATUS"] = "ARCHIVED";
             });
-            AssertNextUpdate(e, "ORDER_SHIPMENTS", "SHIPMENT_ID", 10301, (d) =>
+            AssertNextUpdate(e, "ORDER_SHIPMENTS", "SHIPMENT_ID", 10301, d =>
             {
                 d["QUANTITY"] = 54321;
             });
-            AssertNextUpdate(e, "ORDER_SHIPMENTS", "SHIPMENT_ID", 10302, (d) =>
+            AssertNextUpdate(e, "ORDER_SHIPMENTS", "SHIPMENT_ID", 10302, d =>
             {
                 d["QUANTITY"] = 54321;
             });
-            AssertNextUpdate(e, "ORDER_SHIPMENTS", "SHIPMENT_ID", 10304, (d) =>
+            AssertNextUpdate(e, "ORDER_SHIPMENTS", "SHIPMENT_ID", 10304, d =>
             {
                 d["QUANTITY"] = 54321;
             });
             AssertNextDelete(e, "ORDER_SHIPMENTS", "SHIPMENT_ID", 10303);
-            AssertNextUpdate(e, "ORDER_LINES", "LINE_ID", 201, (d) =>
+            AssertNextUpdate(e, "ORDER_LINES", "LINE_ID", 201, d =>
             {
                 d["QUANTITY"] = 12345;
             });
             AssertNextDelete(e, "ORDER_SHIPMENTS", "SHIPMENT_ID", 20201);
             AssertNextDelete(e, "ORDER_SHIPMENTS", "SHIPMENT_ID", 20202);
             AssertNextDelete(e, "ORDER_LINES", "LINE_ID", 202);
-            AssertNextInsert(e, "ORDERS", (d) =>
+            AssertNextInsert(e, "ORDERS", d =>
             {
                 d["ORDER_ID"] = 1000001;
                 d["ORDER_NUMBER"] = "N-004";
                 d["STATUS"] = "ACTIVE";
                 d["CUSTOMER_ID"] = 4;
             });
-            AssertNextInsert(e, "ORDER_LINES", (d) =>
+            AssertNextInsert(e, "ORDER_LINES", d =>
             {
                 d["ORDER_ID"] = 1000001;
                 d["LINE_ID"] = 1500001;
                 d["QUANTITY"] = 10;
                 d["UNIT"] = "U1";
             });
-            AssertNextInsert(e, "ORDER_SHIPMENTS", (d) =>
+            AssertNextInsert(e, "ORDER_SHIPMENTS", d =>
             {
                 d["ORDER_LINE_ID"] = 1500001;
                 d["SHIPMENT_ID"] = 1900001;
                 d["QUANTITY"] = 1;
                 d["SHIP_DATE"] = new DateTime(2012, 3, 5);
             });
-            AssertNextInsert(e, "ORDER_SHIPMENTS", (d) =>
+            AssertNextInsert(e, "ORDER_SHIPMENTS", d =>
             {
                 d["ORDER_LINE_ID"] = 1500001;
                 d["SHIPMENT_ID"] = 1900002;
                 d["QUANTITY"] = 1;
                 d["SHIP_DATE"] = new DateTime(2012, 3, 5);
             });
-            AssertNextInsert(e, "ORDER_SHIPMENTS", (d) =>
+            AssertNextInsert(e, "ORDER_SHIPMENTS", d =>
             {
                 d["ORDER_LINE_ID"] = 1500001;
                 d["SHIPMENT_ID"] = 1900003;
                 d["QUANTITY"] = 1;
                 d["SHIP_DATE"] = new DateTime(2012, 3, 5);
             });
-            AssertNextInsert(e, "ORDER_SHIPMENTS", (d) =>
+            AssertNextInsert(e, "ORDER_SHIPMENTS", d =>
             {
                 d["ORDER_LINE_ID"] = 1500001;
                 d["SHIPMENT_ID"] = 1900004;
                 d["QUANTITY"] = 1;
                 d["SHIP_DATE"] = new DateTime(2012, 3, 5);
             });
-            AssertNextInsert(e, "ORDER_LINES", (d) =>
+            AssertNextInsert(e, "ORDER_LINES", d =>
             {
                 d["ORDER_ID"] = 1000001;
                 d["LINE_ID"] = 1500002;
                 d["QUANTITY"] = 2;
                 d["UNIT"] = "U2";
             });
-            AssertNextInsert(e, "ORDER_SHIPMENTS", (d) =>
+            AssertNextInsert(e, "ORDER_SHIPMENTS", d =>
             {
                 d["ORDER_LINE_ID"] = 1500002;
                 d["SHIPMENT_ID"] = 1900005;
                 d["QUANTITY"] = 1;
                 d["SHIP_DATE"] = new DateTime(2012, 3, 5);
             });
-            AssertNextInsert(e, "ORDER_SHIPMENTS", (d) =>
+            AssertNextInsert(e, "ORDER_SHIPMENTS", d =>
             {
                 d["ORDER_LINE_ID"] = 1500002;
                 d["SHIPMENT_ID"] = 1900006;
         public void TestChange()
         {
             this.DoChange();
-            this.DoCheck(this.CreateResolver().Resolve().ToList());
+            var r = this.CreateResolver();
+            this.DoCheck(r.Resolve().ToList());
+            r.Generator = CreateGenerator();
+            this.DoCheck(r.Resolve().ToList());
         }
         [Test]
         public void TestSettleChange()
                 if (k == "ORDER_SHIPMENTS") return this.newShips;
                 throw new Exception("Unknown key: " + k);
             });
+            Assert.AreEqual(0, s.Resolve().ToArray().Length);
             this.DoChange();
             this.DoCheck(s.Resolve().ToList());
+            s.Generator = CreateGenerator();
+            this.DoCheck(s.Resolve().ToList());
         }
     }
 }