Beispiel #1
0
 public ViaCepService()
 {
     _cliente                      = new ViaCepCliente();
     _enderecoConvert              = new EnderecoConvert();
     _requisicaoPorCepFactory      = new ViaCepRequisicaoPorCepFactory();
     _requisicaoPorEnderecoFactory = new ViaCepRequisicaoPorEnderecoFactory();
 }
Beispiel #2
0
 /// <inheritdoc />
 public ViaCepService(IViaCepCliente viaCepCliente,
                      IEnderecoConvert enderecoConvert,
                      IViaCepRequisicaoPorCepFactory requisicaoPorCepFactory,
                      IViaCepRequisicaoPorEnderecoFactory requisicaoPorEnderecoFactory)
 {
     _cliente                      = viaCepCliente ?? throw new ArgumentNullException(nameof(viaCepCliente));
     _enderecoConvert              = enderecoConvert ?? throw new ArgumentNullException(nameof(enderecoConvert));
     _requisicaoPorCepFactory      = requisicaoPorCepFactory ?? throw new ArgumentNullException(nameof(requisicaoPorCepFactory));
     _requisicaoPorEnderecoFactory = requisicaoPorEnderecoFactory ?? throw new ArgumentNullException(nameof(requisicaoPorEnderecoFactory));
 }
Beispiel #3
0
        public ViaCep(IViaCepCliente cliente, IViaCepRequisicaoPorCepFactory requisicaoPorCepFactory, IViaCepRequisicaoPorEnderecoFactory requisicaoPorEnderecoFactory)
        {
            if (cliente == null)
            {
                throw new ArgumentNullException(nameof(cliente));
            }

            if (requisicaoPorCepFactory == null)
            {
                throw new ArgumentNullException(nameof(requisicaoPorCepFactory));
            }

            if (requisicaoPorEnderecoFactory == null)
            {
                throw new ArgumentNullException(nameof(requisicaoPorEnderecoFactory));
            }

            _cliente = cliente;
            _requisicaoPorCepFactory      = requisicaoPorCepFactory;
            _requisicaoPorEnderecoFactory = requisicaoPorEnderecoFactory;
        }
Beispiel #4
0
 public void SetUp()
 {
     _requisicaoPorCepFactory = new ViaCepRequisicaoPorCepFactory();
     _cep     = "01001000";
     _cliente = new ViaCepCliente();
 }