Beispiel #1
0
        public void And_I_Do_Not_Have_Correct_Role_Then_Redirect_To_Search_Start_Page()
        {
            var controllerWithClaims = new ClaimsBuilder <AccountController>(_accountController)
                                       .AddStandardUser()
                                       .Build();

            var result = controllerWithClaims.PostSignIn();

            result.Should().BeOfType <RedirectToActionResult>();

            var redirectResult = result as RedirectToActionResult;

            redirectResult.Should().NotBeNull();
            redirectResult?.ControllerName.Should().Be("Dashboard");
            redirectResult?.ActionName.Should().Be("Start");
        }
Beispiel #2
0
        public void And_I_Do_Not_Have_Correct_Role_Then_Redirect_To_FailedLogin_Page()
        {
            var controllerWithClaims = new ClaimsBuilder <AccountController>(_accountController)
                                       .AddUserName("username")
                                       .Build();

            var result = controllerWithClaims.PostSignIn();

            result.Should().BeOfType <RedirectToActionResult>();

            var redirectResult = result as RedirectToActionResult;

            redirectResult.Should().NotBeNull();
            redirectResult?.ControllerName.Should().Be("Home");
            redirectResult?.ActionName.Should().Be("FailedLogin");
        }