public async Task パスワードを新しく登録する() { // Arrange var authorizationLink = new AuthorizationLink("C12345", new DateTime(2020, 9, 1)); var userManager = MockMaker.MakeMoqUserManager(); userManager .Setup(o => o.FindByNameAsync("C12345")) .ReturnsAsync(new ApplicationUser()) .Verifiable(); userManager .Setup(o => o.ConfirmEmailAsync(It.IsAny <ApplicationUser>(), "hijklmn")) .ReturnsAsync(IdentityResult.Success) .Verifiable(); userManager .Setup(o => o.RemovePasswordAsync(It.IsAny <ApplicationUser>())) .ReturnsAsync(IdentityResult.Success) .Verifiable(); userManager .Setup(o => o.AddPasswordAsync(It.IsAny <ApplicationUser>(), "abcdefg")) .ReturnsAsync(IdentityResult.Success) .Verifiable(); var signInManager = MockMaker.MakeMockSignInManager(userManager.Object); var service = new AccountService( signInManager.Object, new Mock <IAccountsUseCase>().Object, new Mock <IAuthorizationUseCase>().Object); // Act await service.SetupPassword("C12345", "abcdefg", "hijklmn"); // Assert userManager.Verify(); }
public async Task <AuthorizationLink> AddAuthorizationLink(string uniqueKey) { var confirmationMailAddress = new AuthorizationLink( uniqueKey, DateTime.Now); return(await this.authorizationLinkRepository.Add(confirmationMailAddress)); }
private void OpenLink() { try { Process = Process.Start(AuthorizationLink.ToString()); } catch (SecurityException) { MessageBox.Show("Error while opening web-link, please copy and paste the link to your web-browser.", "Authorization", MessageBoxButton.OK, MessageBoxImage.Information); } }
private void CopyLink() { Clipboard.SetText(AuthorizationLink.ToString()); }