public void When_GettingEmailConfirmationLink_Expect_CorrectLink(string email, string token)
        {
            var actualLink = _urlService.GetEmailConfirmationLink(email, token);

            Assert.Equal(
                $"https://localhost:5001/confirm-email?email={email}&token={token}",
                actualLink
                );
        }
Exemple #2
0
        public async Task SendConfirmationEmail(string userId)
        {
            var user = await _userManager.FindByIdAsync(userId);

            var emailConfirmationToken = await _userManager.GenerateEmailConfirmationTokenAsync(user);

            var encodedEmailConfirmationToken = _encodingService.GetWebEncodedString(emailConfirmationToken);
            var emailConfirmationLink         = _urlService.GetEmailConfirmationLink(user.Email, encodedEmailConfirmationToken);
            await _emailService.SendConfirmationEmail(user.Email, emailConfirmationLink);
        }