예제 #1
0
        public void SendDocumentTest()
        {
            var name     = "20600995805-01-F001-00005214";
            var filePath = Path.Combine(Environment.CurrentDirectory, "Resources", name + ".xml");
            var content  = File.ReadAllBytes(filePath);

            var task = _manager.SendDocument(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.ApplicationResponse);
            StringAssert.Contains(result.ApplicationResponse.Descripcion, "aceptada");
            Trace.WriteLine(result.ApplicationResponse.Descripcion);
        }
예제 #2
0
        private async Task <WsResult> SendDoc(string xmlfile, byte[] content)
        {
            var res = await _wsManager.SendDocument(xmlfile, content);

            return(FromSunatResponse(res));
        }