Пример #1
0
        private async Task <WsResult> SendSumm(string xmlPath, byte[] content)
        {
            var res = await _wsManager.SendSummary(xmlPath, content);

            var result = new WsResult
            {
                Success = res.Success
            };

            if (res.Success)
            {
                result.Code        = CodeStatus.EnviadoPorProcesar;
                result.Description = res.Ticket;
            }
            else
            {
                result.Code        = CodeStatus.ConErrores;
                result.Description = $"{res.Error.Code} - {res.Error.Description}";
            }
            return(result);
        }
Пример #2
0
        public void SendSummaryTest()
        {
            //TODO: update v2.1
            var name     = "20600995805-RC-20171128-01";
            var filePath = Path.Combine(Environment.CurrentDirectory, "Resources", name + ".xml");
            var content  = File.ReadAllBytes(filePath);

            var task = _manager.SendSummary(name, content);

            task.Wait(5000);

            var result = task.Result;

            if (!result.Success)
            {
                Trace.WriteLine(result.Error.Code + " - " + result.Error.Description);
            }

            Assert.IsTrue(result.Success);
            Assert.IsNotNull(result.Ticket);

            Trace.WriteLine("Ticket: " + result.Ticket);
        }