Ejemplo n.º 1
0
        public async Task ThenIGetWhenTryingToModifyTenantSEmailFromTo(string errorMessage, string findEmail, string modifyEmail)
        {
            var repo = Resolve <ITenantRepository>();

            var entity = await repo.FindByEmailAsync(findEmail);

            entity.Should().NotBeNull();

            var data = TenantData.From(entity);

            data.Email = modifyEmail;

            var command = new ModifyTenantCommand(entity.Id, data, entity.ConcurrencyToken);

            CommandResult <Tenant> result = await GetTenantCommandResult(command);

            result.Succeeded.Should().BeFalse();
            result.ValidationMessages.Should().Contain(errorMessage);
        }