示例#1
0
        public async Task Index_should_redirect_to_homepage_if_user_is_authenticated()
        {
            // When
            var result = await authenticatedController.Index("email", "code");

            // Then
            result.Should().BeRedirectToActionResult().WithControllerName("Home").WithActionName("Index");
        }
示例#2
0
        public async Task Index_should_render_if_user_is_unauthenticated_and_query_params_are_valid()
        {
            // Given
            A.CallTo(
                () => passwordResetService.EmailAndResetPasswordHashAreValidAsync(
                    "email",
                    "code",
                    ResetPasswordHelpers.ResetPasswordHashExpiryTime
                    )
                )
            .Returns(Task.FromResult(true));

            // When
            var result = await unauthenticatedController.Index("email", "code");

            // Then
            result.Should().BeViewResult().WithDefaultViewName();
        }