public void FindUserByIdTest() { IDatabase database = new Database(TestUtils.ConnString); Assert.NotNull(database); UserDao userDao = new UserDao(database); InsertDummyData(userDao); Assert.Equal(items.Count, userDao.Count()); User myUser = userDao.FindById(USER1_NAME); Assert.NotNull(myUser); Assert.Equal(USER1_NAME, myUser.Username); Assert.Equal(USER1_PASSWORD, myUser.Password); Assert.Equal(USER1_MAIL, myUser.Email); userDao.Delete(myUser.Username); Assert.Equal(3, userDao.Count()); }
public void DeleteUserTest() { IDatabase database = new Database(TestUtils.ConnString); Assert.NotNull(database); UserDao userDao = new UserDao(database); InsertDummyData(userDao); Assert.Equal(items.Count, userDao.Count()); foreach (var item in items) { userDao.Delete(item.Username); } Assert.Equal(0, userDao.Count()); }