Exemplo n.º 1
0
        public void Login_Works_When_Accepted()
        {
            authService = new MockTokenAuthService(MockAuthBehaviour.AcceptByDefault);
            service     = new LoginService(userService, authService);

            var loginAttempt = service.AuthenticateEmailAndPassword(new EmailLoginDto {
                Email    = TestData.user.Email,
                Password = ""
            });

            Assert.IsTrue(loginAttempt.Accepted);
        }
Exemplo n.º 2
0
        public void Login_Fails_When_Rejected()
        {
            userService = new MockUserService(false);
            authService = new MockTokenAuthService(MockAuthBehaviour.RejectByDefault);
            service     = new LoginService(userService, authService);

            var loginAttempt = service.AuthenticateEmailAndPassword(new EmailLoginDto
            {
                Email    = TestData.user.Email,
                Password = ""
            });

            Assert.IsFalse(loginAttempt.Accepted);
        }