public async Task <OperationResult <AddressDto> > UpdateAddressAsync(UpdateAddressInput input)
        {
            var validatioResult = await _addressValidator.ValidateUpdateAddressAsync(input);

            if (validatioResult.IsSuccess)
            {
                var addresses = await _addressRepository.GetByCustomerAsync(input.CustomerEmail);

                var address = input.ConvertToEntity();


                foreach (var e in addresses.Addresses.Where(a => a.Id == input.AddressId))
                {
                    e.Name           = address.Name;
                    e.ZipCode        = address.ZipCode;
                    e.City           = address.City;
                    e.Street         = address.Street;
                    e.Number         = address.Number;
                    e.Depatarment    = address.Depatarment;
                    e.BetweenStreet1 = address.BetweenStreet1;
                    e.BetweenStreet2 = address.BetweenStreet2;
                    e.Observations   = address.Observations;
                    e.Phone          = address.Phone;
                    e.Type           = address.Type;
                    e.CustomerEmail  = address.CustomerEmail;
                }

                await _addressRepository.UpdateAsync(addresses);

                return(OperationResult <AddressDto> .Success(address.ConvertToDto()));
            }

            return(OperationResult <AddressDto> .Fail(validatioResult));
        }
        public void ConvertToEntity_InputNotNull_ReturnSameObservations()
        {
            UpdateAddressInput input = MockUpdateAddressInput();

            Address address = input.ConvertToEntity();

            Assert.Equal(input.Observations, address.Observations);
        }
        public void ConvertToEntity_InputNotNull_ReturnSameId()
        {
            UpdateAddressInput input = MockUpdateAddressInput();

            Address address = input.ConvertToEntity();

            Assert.Equal(input.AddressId, address.Id);
        }
        public void ConvertToEntity_InputNotNull_ReturnSameNumber()
        {
            UpdateAddressInput input = MockUpdateAddressInput();

            Address address = input.ConvertToEntity();

            Assert.Equal(input.Number, address.Number);
        }
        public void ConvertToEntity_InputNotNull_ReturnSameDepatarment()
        {
            UpdateAddressInput input = MockUpdateAddressInput();

            Address address = input.ConvertToEntity();

            Assert.Equal(input.Depatarment, address.Depatarment);
        }
        public void ConvertToEntity_InputNotNull_ReturnSameCustomerEmail()
        {
            UpdateAddressInput input = MockUpdateAddressInput();

            Address address = input.ConvertToEntity();

            Assert.Equal(input.CustomerEmail, address.CustomerEmail);
        }
        public void ConvertToEntity_InputNotNull_ReturnSameBetweenStreet2()
        {
            UpdateAddressInput input = MockUpdateAddressInput();

            Address address = input.ConvertToEntity();

            Assert.Equal(input.BetweenStreet2, address.BetweenStreet2);
        }
        public void ConvertToEntity_InputNotNull_ReturnSameZipCode()
        {
            UpdateAddressInput input = MockUpdateAddressInput();

            Address address = input.ConvertToEntity();

            Assert.Equal(input.ZipCode, address.ZipCode);
        }
        public void ConvertToEntity_InputNotNull_ReturnSameStreet()
        {
            UpdateAddressInput input = MockUpdateAddressInput();

            Address address = input.ConvertToEntity();

            Assert.Equal(input.Street, address.Street);
        }