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); }
public async Task FindById() { IUserDao userDao = new AdoUserDao(DefaultConnectionFactory.FromConfiguration(_connectionStringConfigName)); User user = await userDao.FindByIdAsync(1); Assert.IsTrue(user.Id == 1); }