public void Activate_Should_Return_RedirectResult_When_Key_Is_Empty()
        {
            // Arrange + Act
            ActionResult result = _userController.Activate("");

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 2
0
        public void activate_should_return_redirectresult_when_key_is_empty()
        {
            // Arrange + Act
            ActionResult result = _userController.Activate("");

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
        public void Profile_GET_Should_Redirect_If_No_Logged_In_User()
        {
            // Arrange
            _applicationSettings.UseWindowsAuthentication = false;

            // Act
            ActionResult result = _userController.Profile();

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Login");
        }
        public void Logout_Should_Have_RedirectResult()
        {
            // Arrange

            // Act
            ActionResult result = _userController.Logout();

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
        public void Profile_POST_Should_Redirect_If_Summary_Has_No_Id()
        {
            // Arrange
            UserViewModel model = new UserViewModel();

            // Act
            ActionResult result = _userController.Profile(model);

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Login");
        }
Esempio n. 6
0
        public void profile_post_should_redirect_if_summary_has_no_id()
        {
            // Arrange
            UserViewModel model = new UserViewModel();

            // Act
            ActionResult result = _userController.Profile(model);

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Login");
        }
Esempio n. 7
0
        public void profile_get_should_redirect_if_no_logged_in_user()
        {
            // Arrange
            _applicationSettings.UseWindowsAuthentication = false;

            // Act
            ActionResult result = _userController.Profile();

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Login");
        }
        public void Signup_POST_With_Signups_Disabled_Should_Return_RedirectResult()
        {
            // Arrange
            _repository.SiteSettings.AllowUserSignup = false;

            // Act
            ActionResult result = _userController.Signup(null, null);

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 9
0
        public void login_post_should_redirect_when_windows_authentication_is_enabled()
        {
            // Arrange
            _applicationSettings.UseWindowsAuthentication = true;

            // Act
            ActionResult result = _userController.Login(AdminEmail, AdminPassword, "");

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 10
0
        public void Login_POST_Should_Redirect_When_Windows_Authentication_Is_Enabled()
        {
            // Arrange
            _applicationSettings.UseWindowsAuthentication = true;

            // Act
            ActionResult result = _userController.Login(AdminEmail, AdminPassword, "");

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 11
0
        public void Activate_Should_Redirect_When_Windows_Authentication_Is_Enabled()
        {
            // Arrange
            _applicationSettings.UseWindowsAuthentication = true;

            // Act
            ActionResult result = _userController.Activate(UserServiceMock.ACTIVATIONKEY);

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 12
0
        public void UnattendedSetup_Should_Redirect_When_Installed_Is_True()
        {
            // Arrange
            _applicationSettings.Installed = true;

            // Act
            ActionResult result = _installController.Unattended("mock datastore", "fake connection string");

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 13
0
        public void resetpassword_post_with_windows_auth_enabled_should_return_redirectresult()
        {
            // Arrange
            _applicationSettings.UseWindowsAuthentication = true;

            // Act
            ActionResult result = _userController.ResetPassword("someemail");

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 14
0
        public void signup_post_with_signups_disabled_should_return_redirectresult()
        {
            // Arrange
            _settingsRepository.SiteSettings.AllowUserSignup = false;

            // Act
            ActionResult result = _userController.Signup(null, null);

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 15
0
        public void ResetPassword_POST_With_Windows_Auth_Enabled_Should_Return_RedirectResult()
        {
            // Arrange
            _applicationSettings.UseWindowsAuthentication = true;

            // Act
            ActionResult result = _userController.ResetPassword("someemail");

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 16
0
        public void CompleteResetPassword_GET_With_WindowsAuth_Enabled_Should_Redirect()
        {
            // Arrange
            _applicationSettings.UseWindowsAuthentication = true;

            // Act
            ActionResult result = _userController.CompleteResetPassword("resetkey");

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 17
0
        public void Step1_Should_Redirect_When_Installed_Is_True()
        {
            // Arrange
            _applicationSettings.Installed = true;

            // Act
            ActionResult result = _installController.Step1("en");

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 18
0
        public void Signup_POST_When_LoggedIn_Should_Return_RedirectResult()
        {
            // Arrange

            // Act
            _userController.Login(AdminEmail, AdminPassword, "");
            ActionResult result = _userController.Signup(null, null);

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 19
0
        public void Signup_POST_With_WindowsAuth_Enabled_Should_Return_RedirectResult()
        {
            // Arrange
            _repository.SiteSettings.AllowUserSignup      = true;
            _applicationSettings.UseWindowsAuthentication = true;

            // Act
            ActionResult result = _userController.Signup(null, null);

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 20
0
        public void Signup_GET_Should_Redirect_When_Windows_Auth_Is_Enabled()
        {
            // Arrange
            UserViewModel model = new UserViewModel();

            _applicationSettings.UseWindowsAuthentication = true;

            // Act
            ActionResult result = _userController.Signup();

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 21
0
        public void Signup_GET_Should_Redirect_When_Signups_Are_Disabled()
        {
            // Arrange
            UserViewModel model = new UserViewModel();

            _repository.SiteSettings.AllowUserSignup = false;

            // Act
            ActionResult result = _userController.Signup();

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 22
0
        public void signup_get_should_redirect_when_signups_are_disabled()
        {
            // Arrange
            UserViewModel model = new UserViewModel();

            _settingsRepository.SiteSettings.AllowUserSignup = false;

            // Act
            ActionResult result = _userController.Signup();

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 23
0
        public void CompleteResetPassword_POST_With_Windows_Auth_Enabled_Should_Return_RedirectResult()
        {
            // Arrange
            UserViewModel model = new UserViewModel();

            _applicationSettings.UseWindowsAuthentication = true;

            // Act
            ActionResult result = _userController.CompleteResetPassword("key", model);

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }
Esempio n. 24
0
        public void Signup_GET_Should_Redirect_When_Logged_In()
        {
            // Arrange
            UserViewModel model = new UserViewModel();

            _repository.SiteSettings.AllowUserSignup = true;
            _userContext.CurrentUser = Guid.NewGuid().ToString();

            // Act
            ActionResult result = _userController.Signup();

            // Assert
            RedirectToRouteResult redirectResult = result.AssertResultIs <RedirectToRouteResult>();

            redirectResult.AssertActionRouteIs("Index");
            redirectResult.AssertControllerRouteIs("Home");
        }