public void UpdateEmailAddressOk() { var provider = new AccountProviderBuilder().Build(); var returnedModel = provider.UpdateEmailAddress(Guid.NewGuid(), viewModel); returnedModel.Should().NotBeNull(); returnedModel.UpdateStatus.Should().Be(UpdateEmailStatus.Ok); }
public void UpdateEmailAddressUnknownError() { var userAccountService = new Mock <IUserAccountService>(); userAccountService.Setup(x => x.UpdateUsername(It.IsAny <Guid>(), It.IsAny <string>())).Throws(new Exception()); var provider = new AccountProviderBuilder().With(userAccountService).Build(); var returnedModel = provider.UpdateEmailAddress(Guid.NewGuid(), viewModel); returnedModel.Should().NotBeNull(); returnedModel.UpdateStatus.Should().Be(UpdateEmailStatus.Error); }
public void UpdateEmailAddressAccountAlreadyExixtsCustomError() { var userAccountService = new Mock <IUserAccountService>(); userAccountService.Setup(x => x.UpdateUsername(It.IsAny <Guid>(), It.IsAny <string>())).Throws(new CustomException(ErrorCodes.UserDirectoryAccountExistsError)); var provider = new AccountProviderBuilder().With(userAccountService).Build(); var returnedModel = provider.UpdateEmailAddress(Guid.NewGuid(), viewModel); returnedModel.Should().NotBeNull(); returnedModel.UpdateStatus.Should().Be(UpdateEmailStatus.AccountAlreadyExists); }