Ejemplo n.º 1
0
        public void UpdateEmailAddressOk()
        {
            var provider      = new AccountProviderBuilder().Build();
            var returnedModel = provider.UpdateEmailAddress(Guid.NewGuid(), viewModel);

            returnedModel.Should().NotBeNull();
            returnedModel.UpdateStatus.Should().Be(UpdateEmailStatus.Ok);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }