public void Add <T>(T item_) where T : class, IEntity { EditRepo <T> et = new EditRepo <T>(ent); et.AddEntity(item_); et.Save(); }
public Edit_UOF() { ent = new SQL_entity(); ACQ_D = new EditRepo <T_ACQ_D>(ent); REFMERCHANTS = new UserFilterRepo <DAL.REFMERCHANTS>(ent); KK = new SectorFilterRepo <KEY_CLIENTS>(ent); }
//>>!!! To Unit Test public static void TypeInsertCheck() { SQL_entity ent = new SQL_entity(); EditRepo <KEY_CLIENTS> editRep = new EditRepo <KEY_CLIENTS>(ent); UnitOfWorkGeneric uof = new UnitOfWorkGeneric(ent); uof.RefreshValues(); EntityInitialization entityInit = new EntityInitialization(); entityInit.KEY_CLIENTS_add(uof, 9290000009, 9, "ABCD"); var a = editRep.GetByFilter <KEY_CLIENTS>(s => s.ID != null).Count(); }
//>>!!! To Unit Test public static void UOWcheck() { SQL_entity ent = new SQL_entity(); UnitOfWorkGeneric uof = new UnitOfWorkGeneric(ent); //12 var a = uof.GetByDate <T_ACQ_D>(st, fn).Count(); //5 var b = uof.GetByMerchants <KEY_CLIENTS>().Count(); //10 var c = uof.MerchantListCount(); ReadRepo <KEY_CLIENTS> kkRead = new ReadRepo <KEY_CLIENTS>(ent); //5 var d = uof.GetByMerchants <KEY_CLIENTS>().Count(); uof.DeleteBySector(2); uof.SaveAll(); //4 var e = uof.GetByMerchants <KEY_CLIENTS>().Count(); EditRepo <REFMERCHANTS> rfEdit = new EditRepo <REFMERCHANTS>(ent); //10 var f = uof.MerchantListCount(); uof.DeleteByUserID(0); uof.SaveAll(); //9 var g = uof.MerchantListCount(); uof.RefreshValues(); //27 var h = uof.GetByDate <T_ACQ_D>(st, fn).Count() + uof.GetByMerchants <KEY_CLIENTS>().Count() + uof.MerchantListCount(); }
//>>!!! To Unit Test public static void UOFinsertCheck() { SQL_entity ent = new SQL_entity(); EditRepo <KEY_CLIENTS> editRep = new EditRepo <KEY_CLIENTS>(ent); UnitOfWorkGeneric uof = new UnitOfWorkGeneric(ent); uof.RefreshValues(); KEY_CLIENTS kk = new KEY_CLIENTS { SE_NUMBER = 9290000009, MERCHANT = 9290000009, SECTOR_ID = 9 }; //5 var a = editRep.GetByFilter <KEY_CLIENTS>(s => s.ID != null).Count(); uof.Add <KEY_CLIENTS>(kk); //6 var b = editRep.GetByFilter <KEY_CLIENTS>(s => s.ID != null).Count(); uof.RefreshValues(); //5 var c = editRep.GetByFilter <KEY_CLIENTS>(s => s.ID != null).Count(); }