public static void TestInsert() { var r = new Repo<Country>(new DbContextFactory()); var c = new Country {Name = "Asaaa"}; r.Insert(c); r.Save(); var o = r.Get(c.Id); Assert.AreEqual(c.Name, o.Name); }
public void TestInsert() { var repo = new Repo<Country>(new DbContextFactory()); var country = new Country { Name = "testCountry" }; country = repo.Insert(country); repo.Save(); var country1 = repo.Get(country.Id); Assert.AreEqual(country.Name, country1.Name); }
public static void TestRemove() { var r = new Repo<Country>(new DbContextFactory()); var c = new Country {Name = "a"}; r.Insert(c); r.Save(); r.Delete(c); r.Save(); var o = r.Get(c.Id); Assert.IsTrue(o.IsDeleted); }
public static void TestRemove() { var repo = new Repo<Country>(new DbContextFactory()); var country = new Country { Name = "testCountry" }; country = repo.Insert(country); repo.Save(); repo.Delete(country); repo.Save(); var country1 = repo.Get(country.Id); Assert.IsTrue(country1.IsDeleted); }