Пример #1
0
        public async Task Update()
        {
            IUserDao userDao =
                new AdoUserDao(DefaultConnectionFactory.FromConfiguration(_connectionStringConfigName));

            User user = await userDao.FindByIdAsync(1);

            string email = user.Email;

            user.Email = "*****@*****.**";
            bool update1 = await userDao.UpdateAllAsync(user);

            Assert.IsTrue(update1);
            User user1 = await userDao.FindByIdAsync(1);

            Assert.IsTrue(user1.Email == user.Email);

            user.Email = email;
            bool update2 = await userDao.UpdateAllAsync(user);

            Assert.IsTrue(update2);

            User user2 = await userDao.FindByIdAsync(1);

            Assert.IsTrue(user2.Email == email);
        }
Пример #2
0
        public async Task FindById()
        {
            IUserDao userDao =
                new AdoUserDao(DefaultConnectionFactory.FromConfiguration(_connectionStringConfigName));

            User user = await userDao.FindByIdAsync(1);

            Assert.IsTrue(user.Id == 1);
        }