Esempio n. 1
0
        public void Login_NullUser_ReturnsLoginView()
        {
            Mock<ILoggerService> loggerService = new Mock<ILoggerService>();
            Mock<ILoginService> loginService = new Mock<ILoginService>();
            Mock<IUserService> userService = new Mock<IUserService>();
            Mock<IPasswordService> passwordService = new Mock<IPasswordService>();

            AccountController controller = new AccountController(
                loggerService.Object,
                loginService.Object,
                userService.Object,
                passwordService.Object);

            ActionResult actionResult = controller.Login(null);
        }
Esempio n. 2
0
        public void Login_EmptyCredentials_ReturnsLoginView()
        {
            Mock<ILoggerService> loggerService = new Mock<ILoggerService>();
            Mock<ILoginService> loginService = new Mock<ILoginService>();
            Mock<IUserService> userService = new Mock<IUserService>();
            Mock<IPasswordService> passwordService = new Mock<IPasswordService>();

            AccountController controller = new AccountController(
                loggerService.Object,
                loginService.Object,
                userService.Object,
                passwordService.Object);

            UserViewModel model = new UserViewModel();

            UserEntity user = new UserEntity();
            user.ID = Guid.NewGuid();
            user.Email = string.Empty;
            user.UserPassword = string.Empty;

            model.User = user;

            ActionResult actionResult = controller.Login(model);
        }