Beispiel #1
0
        public async void test_02_that_non_existant_email_returns_ok_without_url()
        {
            await RegisterJaimito();

            var resetToken = new ResetTokenDto {
                Email = "*****@*****.**"
            };
            var result = await RecoveryController.SendResetToken(resetToken) as OkResult;

            result.Should().NotBeNull();
            result.StatusCode.Should().Be(200);
        }
Beispiel #2
0
        public async void test_01_juancito_resets_password()
        {
            await RegisterJaimito();

            var resetToken = new ResetTokenDto {
                Email = Jaimito.Email
            };
            var result = await RecoveryController.SendResetToken(resetToken) as ObjectResult;

            var url = result.Value as string;

            url.Should().NotBeNullOrEmpty();
            var credentials  = GetCredentialsFrom(url, "aDifferentPassword");
            var resultResult = await RecoveryController.ResetPassword(credentials) as OkResult;

            resultResult.Should().NotBeNull();
            resultResult.StatusCode.Should().Be(Status200OK);
            var loginResult = AuthController.Login(new LoginCredentials
            {
                Email = Jaimito.Email, Password = "******"
            }) as OkObjectResult;

            loginResult.StatusCode.Should().Be(Status200OK);
        }