예제 #1
0
        public void UserRepositoryMock_GetUserById()
        {
            UserRepositoryMock urm = new UserRepositoryMock();
            var a = urm.GetUserById(1);

            Assert.IsNotNull(a);
        }
예제 #2
0
        public void UserRepositoryMock_DeleteUser()
        {
            UserRepositoryMock urm = new UserRepositoryMock();

            urm.DeleteUser(1);
            var a = urm.GetUserById(1);

            Assert.IsNull(a);
        }
예제 #3
0
        public void UserRepositoryMock_UpdateUser()
        {
            UserRepositoryMock urm = new UserRepositoryMock();
            User user = new User()
            {
                Username = "******", UserId = 1
            };

            urm.UpdateUser(user);
            var a = urm.GetUserById(1);

            Assert.AreEqual(user, a);
        }
예제 #4
0
        public void UserRepositoryMock_AddUser()
        {
            UserRepositoryMock urm = new UserRepositoryMock();
            User user = new User()
            {
                Username = "******", UserId = 1000
            };

            urm.AddUser(user);
            var a = urm.GetUserById(1000);

            Assert.IsNotNull(a);
        }
예제 #5
0
        public void CanGetUserById()
        {
            User user = repo.GetUserById("11111111-1111-1111-1111-111111111111");

            Assert.AreEqual("11111111-1111-1111-1111-111111111111", user.Id);
            Assert.AreEqual("*****@*****.**", user.Email);
            Assert.AreEqual("Sales Test User 2", user.UserName);
            Assert.AreEqual(0, user.AccessFailedCount);
            Assert.IsFalse(user.EmailConfirmed);
            Assert.IsFalse(user.PhoneNumberConfirmed);
            Assert.IsFalse(user.TwoFactorEnabled);
            Assert.IsFalse(user.LockoutEnabled);
        }