コード例 #1
0
        public void RepositoryTest()
        {
            CrudRepository <Users> userRepo = new CrudRepository <Users>();
            Users user1 = new Users {
                UserFirstName = "Test", UserLastName = "Test"
            };

            userRepo.Add(user1);

            Assert.AreNotEqual(0, user1.Id);

            int id = user1.Id;

            userRepo.Remove(user1);

            Users user2 = userRepo.FindById(id);

            Assert.AreEqual(null, user2);
        }