Exemplo n.º 1
0
        public DgiiQueryResponse Execute(DgiiQueryRequest request)
        {
            var resultaConsulta = new DgiiQueryResponse();

            var datos = CosultarRncCedula(request.Rnc);

            if (datos != null)
            {
                resultaConsulta.Rnc    = datos[0];
                resultaConsulta.Nombre = datos[1];
            }

            return(resultaConsulta);
        }
Exemplo n.º 2
0
        public void TestRncValidoIsOk()
        {
            string[] rncs = new []
            {
                "130-17528-4",
                "130175284",
            };

            foreach (var rnc in rncs)
            {
                DgiiQueryRequest request = new DgiiQueryRequest();
                request.Rnc = rnc;
                DgiiQueryResponse response = dgiiScraper.Execute(request);
                Assert.True(response.IsOk);
                Assert.Equal("130-17528-4", response.Rnc);
                Assert.Equal("ADAM AND EVE CLUB S A", response.Nombre);
            }
        }
Exemplo n.º 3
0
        public void TestCedulaValidaIsOk()
        {
            string[] cedulas = new[]
            {
                "00115620486",
                "001-1562048-6",
            };

            foreach (var cedula in cedulas)
            {
                DgiiQueryRequest request = new DgiiQueryRequest();
                request.Rnc = cedula;
                DgiiQueryResponse response = dgiiScraper.Execute(request);
                Assert.True(response.IsOk);
                Assert.Equal("001-1562048-6", response.Rnc);
                Assert.Equal("ESMELIN SANTIAGO MATIAS GARCIA", response.Nombre);
            }
        }