public void TranslateClaveUnidadTest()
        {
            string input  = "A111";
            var    output = TranslateModelsToCatalogosCFDI.TranslateClaveUnidad(input);

            Assert.AreEqual(cfdi33.c_ClaveUnidad.A111, output);
        }
        public void TranslateCodigoPostalTest()
        {
            string input  = "99100";
            var    output = TranslateModelsToCatalogosCFDI.TranslateCodigoPostal(input);

            Assert.AreEqual(cfdi33.c_CodigoPostal.Item99100, output);
        }
        public void TranslateCadenaPagoNullTest()
        {
            string input  = null;
            var    output = TranslateModelsToCatalogosCFDI.TranslateToCadenaPago(input, out bool isnullValue);

            Assert.AreEqual(isnullValue, true);
        }
        public void TranslateClaveProdServTest()
        {
            string input  = "01010101";
            var    output = TranslateModelsToCatalogosCFDI.TranslateClaveProdServ(input);

            Assert.AreEqual(cfdi33.c_ClaveProdServ.Item01010101, output);
        }
        public void TranslateMonedaMXN()
        {
            string input  = "MXN";
            var    output = TranslateModelsToCatalogosCFDI.TranslateMoneda(input);

            Assert.AreEqual(cfdi33.c_Moneda.MXN, output);
        }
        public void TranslateRegimenFiscalTest()
        {
            string input = "601";

            var output = TranslateModelsToCatalogosCFDI.TranslateRegimenFiscal(input);

            Assert.AreEqual(cfdi33.c_RegimenFiscal.Item601, output);
        }
        public void TranslateCadenaPagoTest()
        {
            var input  = "01";
            var output = TranslateModelsToCatalogosCFDI.TranslateToCadenaPago(input, out bool isnullValue);

            Assert.AreEqual(isnullValue, false);
            Assert.AreEqual(output, cfdi33.c_TipoCadenaPago.Item01);
        }
        public void TranslateUsoCFDITest()
        {
            string input = "G01";

            var output = TranslateModelsToCatalogosCFDI.TranslateUsoCFDI(input);

            Assert.AreEqual(cfdi33.c_UsoCFDI.G01, output);
        }
        public void TranslateFormaPagoTest()
        {
            bool   specifiedField = false;
            string input          = "01";
            var    output         = TranslateModelsToCatalogosCFDI.TranslateFormaPago(input, ref specifiedField);

            Assert.AreEqual(true, specifiedField);
            Assert.AreEqual(cfdi33.c_FormaPago.Item01, output);
        }
        public void TranslateMetodoPagoTest()
        {
            string input          = "PUE";
            bool   specifiedField = false;
            var    output         = TranslateModelsToCatalogosCFDI.TranslateMetodoPago(input, ref specifiedField);

            Assert.AreEqual(true, specifiedField);
            Assert.AreEqual(cfdi33.c_MetodoPago.PUE, output);
        }
        public void TranslateFechaTest()
        {
            // Revisar el cambio de hora. PRobablemente por el offset
            DateTime input  = DateTime.Parse("2017-06-24T08:56:06.155Z");
            var      output = TranslateModelsToCatalogosCFDI.TranslateFecha(input);
            var      result = output.ToString("yyyy-MM-ddThh:mm:ss");

            Assert.AreEqual("2017-06-24T03:56:06", result);
        }
 public void TranslateCadenaPagoInvalidTest()
 {
     try
     {
         string input  = "03";
         var    output = TranslateModelsToCatalogosCFDI.TranslateToCadenaPago(input, out bool isnullValue);
         Assert.Fail();
     }
     catch (InvalidCastException)
     {
         Assert.IsTrue(true);
     }
 }
        public void TranslateCodigoPostalInvalidTest()
        {
            string input = "900";

            try
            {
                var output = TranslateModelsToCatalogosCFDI.TranslateCodigoPostal(input);
                Assert.Fail();
            }
            catch (InvalidCastException)
            {
                Assert.IsTrue(true);
            }
        }
        public void TranslateClaveProdServInvalidTest()
        {
            string input = "ITEM10202402";

            try
            {
                var output = TranslateModelsToCatalogosCFDI.TranslateClaveProdServ(input);
                Assert.Fail();
            }
            catch (InvalidCastException)
            {
                Assert.IsTrue(true);
            }
        }
        public void TranslateUsoCFDIInvalidTest()
        {
            string input = "T01";

            try
            {
                var output = TranslateModelsToCatalogosCFDI.TranslateUsoCFDI(input);
                Assert.Fail();
            }
            catch (InvalidCastException)
            {
                Assert.IsTrue(true);
            }
        }
        public void TranslateMonedaInvalid()
        {
            string input = "8888888888";

            try
            {
                var output = TranslateModelsToCatalogosCFDI.TranslateMoneda(input);
                Assert.Fail();
            }
            catch (InvalidCastException)
            {
                Assert.IsTrue(true);
            }
        }
        public void TranslateRegimenFiscalInvalidTest()
        {
            string input = "Item601";

            try
            {
                var output = TranslateModelsToCatalogosCFDI.TranslateRegimenFiscal(input);
                Assert.Fail();
            }
            catch (InvalidCastException)
            {
                Assert.IsTrue(true);
            }
        }
        public void TranslateMetodoPagoNull()
        {
            string input          = null;
            bool   specifiedField = false;

            try
            {
                var output = TranslateModelsToCatalogosCFDI.TranslateMetodoPago(input, ref specifiedField);
                Assert.AreEqual(false, specifiedField);
            }
            catch (InvalidCastException)
            {
                Assert.IsTrue(true);
            }
        }
        public void TranslateMetodoPagoInvalidTest()
        {
            string input          = "8888888888";
            bool   specifiedField = false;

            try
            {
                var output = TranslateModelsToCatalogosCFDI.TranslateMetodoPago(input, ref specifiedField);
                Assert.Fail();
            }
            catch (InvalidCastException)
            {
                Assert.IsTrue(true);
            }
        }
        public void TranslateFormaPagoNullTest()
        {
            bool   specifiedField = false;
            string input          = null;

            try
            {
                var output = TranslateModelsToCatalogosCFDI.TranslateFormaPago(input, ref specifiedField);
                Assert.AreEqual(false, specifiedField);
            }
            catch (InvalidCastException)
            {
                Assert.Fail();
            }
        }