private void TestUpdate <T>(DAL.Abstractions.IGenericRepository <T> rep, T entity) { ChangeColor(); Console.WriteLine($"Update entity {entity}"); ReturnColor(); rep.Update(entity); rep.Save(); }
private void TestInsert <T>(DAL.Abstractions.IGenericRepository <T> rep, T entity) { ChangeColor(); Console.WriteLine($"Insert {entity}"); ReturnColor(); rep.Insert(entity); rep.Save(); }
private void TestDeleteById <T>(DAL.Abstractions.IGenericRepository <T> rep) { ChangeColor(); int rand = random.Next(rep.Get().Count()) + 1; Console.WriteLine($"Test DeleteById(id) id={rand}"); Console.WriteLine(rep.GetById(rand)); rep.Delete(rand); rep.Save(); ReturnColor(); }