public void LoginPost_WhenCredentialsAreCorrect_ShouldSetAuthCookie()
        {
            var mockAccountService = new Mock<IAccountService>();
            mockAccountService.Setup(x => x.Authenticate("testuser", "correctpassword")).Returns(true);
            mockAccountService.Setup(x => x.SetAuthCookie("testuser", false)).Verifiable();

            var controller = new AccountController(mockAccountService.Object);

            var result = controller.Login(new LoginModel { Username = "******", Password = "******" });

            mockAccountService.Verify(x => x.SetAuthCookie("testuser", false));
        }
        private AccountController GetAccountController()
        {
            var mockAccountService = new Mock<IAccountService>();
            mockAccountService.Setup(x => x.Authenticate("testuser", "correctpassword")).Returns(true);
            mockAccountService.Setup(x => x.Authenticate("testuser", "incorrectpassword")).Returns(false);

            var controller = new AccountController(mockAccountService.Object);

            return controller;
        }