コード例 #1
0
ファイル: RepoTest.cs プロジェクト: ibinod3676/prodinner
 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);
 }
コード例 #2
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);
 }
コード例 #3
0
ファイル: RepoTest.cs プロジェクト: ibinod3676/prodinner
        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);
        }
コード例 #4
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);
        }