Beispiel #1
0
        public async Task FindByUsername()
        {
            IUserDao userDao =
                new AdoUserDao(DefaultConnectionFactory.FromConfiguration(_connectionStringConfigName));

            User user = await userDao.FindByUsernameAsync("max.müller");

            Assert.IsTrue(user.Username == "max.müller");
        }
Beispiel #2
0
        public async Task Delete()
        {
            IUserDao userDao =
                new AdoUserDao(DefaultConnectionFactory.FromConfiguration(_connectionStringConfigName));

            User user   = new User("test1", "test1", "*****@*****.**", "test1", "test1", new DateTime(2010, 8, 18), 1);
            bool insert = await userDao.AddUserAsync(user);

            Assert.IsTrue(insert);

            User user1 = await userDao.FindByUsernameAsync("test1");

            Assert.IsTrue(user1 != null && user1.Username == "test1");

            bool delete = await userDao.DeleteUserAsync(user1);

            Assert.IsTrue(delete);

            User user2 = await userDao.FindByUsernameAsync("test1");

            Assert.IsTrue(user2 == null);
        }