示例#1
0
 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);
 }
示例#2
0
        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);
        }