public void ValidateResponse_XMLConMultiplesEsquemas_Body_And_Header_False_Ambos() { string response = File.ReadAllText(Path.Combine(path, @"Files\Response_MultipleEsquemas.xml")); ValidationCollections validaciones = new ValidationCollections { ValidationsHeader = new List <Validation>() { new Validation("Envelope.Header") { Operation = ValidationOperation.NotEquals, Tag = "Envelope.Header.Header.Transaccion.Canal", Values = new List <string> { "1" }, } }, ValidationsBody = new List <Validation>() { new Validation("Envelope.Body") { Operation = ValidationOperation.NotEquals, Tag = "Envelope.Body.ConsultarEstadosFolioCajaResponse.ResultadoOperacion.Codigo", Values = new List <string> { "OEX-00" }, } } }; var estado = new SoapManager(null).ValidateSection(response, validaciones); Assert.AreEqual <bool>(estado, false); }
public void ValidateResponse_XMLSimple_Body_And_Header_True() { string response = File.ReadAllText(Path.Combine(path, @"Files\Response_simple.xml")); ValidationCollections validaciones = new ValidationCollections { ValidationsHeader = new List <Validation>() { new Validation("Envelope.Header") { Operation = ValidationOperation.Equals, Tag = "Envelope.Header.Header.Transaccion.Canal", Values = new List <string> { "1" }, } }, ValidationsBody = new List <Validation>() { new Validation("Envelope.Body") { Operation = ValidationOperation.NotEquals, Tag = "Envelope.Body.ObtenerProductoResponse.ObtenerProductoResult.Precio", Values = new List <string> { "3200", "2800" }, } } }; var estado = new SoapManager(null).ValidateSection(response, validaciones); Assert.AreEqual <bool>(estado, true); }
public void ValidateResponse_XMLFault_SinDefiniciones_False() { string response = File.ReadAllText(Path.Combine(path, @"Files\Response_Fault.xml")); ValidationCollections validaciones = new ValidationCollections { }; var estado = new SoapManager(null).ValidateSection(response, validaciones); Assert.AreEqual <bool>(estado, false); }
/// <summary> /// 멤버정보 조회 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnGetMemberInfo_Click(object sender, EventArgs e) { //000720121009000007 _client = new ClientManager().GetClient(_reservationType, txtID.Text, txtPwd.Text); if (_client != null) { _client = SoapManager.GetClient(_client); lbMemberInfo.Text = _client.ToString(); gbSetting.Enabled = true; btnReserve.Enabled = true; } else { MessageBox.Show(@"등록되지 않은 아이디 입니다."); } }
public void ValidateResponse_XMLSimple_ValoNulo2_True() { string response = File.ReadAllText(Path.Combine(path, @"Files\Response_simple.xml")); ValidationCollections validaciones = new ValidationCollections { ValidationsBody = new List <Validation>() { new Validation("Envelope.Body") { Operation = ValidationOperation.NotEquals, Tag = "ObtenerProductoResponse.ObtenerProductoResult.Precio", Values = new List <string> { Excel.KeyNull }, } } }; var estado = new SoapManager(null).ValidateSection(response, validaciones); Assert.AreEqual <bool>(estado, true); }
public void ValidateResponse_XMLSimple_Major_False() { string response = File.ReadAllText(Path.Combine(path, @"Files\Response_simple.xml")); ValidationCollections validaciones = new ValidationCollections { ValidationsBody = new List <Validation>() { new Validation("Envelope.Body") { Operation = ValidationOperation.Major, Tag = "Envelope.Body.ObtenerProductoResponse.ObtenerProductoResult.Precio", Values = new List <string> { "200", "10800" }, } } }; var estado = new SoapManager(null).ValidateSection(response, validaciones); Assert.AreEqual <bool>(estado, false); }
public void ValidateResponse_XMLFault_NombreCorto_True() { string response = File.ReadAllText(Path.Combine(path, @"Files\Response_Fault.xml")); ValidationCollections validaciones = new ValidationCollections { ValidationsFault = new List <Validation>() { new Validation("Envelope.Body.Fault") { Operation = ValidationOperation.Equals, Tag = "faultcode", Values = new List <string> { "soap:Server" }, } } }; var estado = new SoapManager(null).ValidateSection(response, validaciones); Assert.AreEqual <bool>(estado, true); }
public void ValidateResponse_XMLConMultiplesEsquemas_Header_False() { string response = File.ReadAllText(Path.Combine(path, @"Files\Response_MultipleEsquemas.xml")); ValidationCollections validaciones = new ValidationCollections { ValidationsHeader = new List <Validation>() { new Validation("Envelope.Header") { Operation = ValidationOperation.Equals, Tag = "Envelope.Header.Header.Transaccion.Canal", Values = new List <string> { "2" }, } } }; var estado = new SoapManager(null).ValidateSection(response, validaciones); Assert.AreEqual <bool>(estado, false); }
public void ValidateResponse_XMLConMultiplesEsquemas_Body_True() { string response = File.ReadAllText(Path.Combine(path, @"Files\Response_MultipleEsquemas.xml")); ValidationCollections validaciones = new ValidationCollections { ValidationsBody = new List <Validation>() { new Validation("Envelope.Body") { Operation = ValidationOperation.Equals, Tag = "Envelope.Body.ConsultarEstadosFolioCajaResponse.ResultadoOperacion.Codigo", Values = new List <string> { "OEX-00", "FUN-01", "FUN-02", "TEC-01", "TEC-03" }, } } }; var estado = new SoapManager(null).ValidateSection(response, validaciones); Assert.AreEqual <bool>(estado, true); }
public void ValidateResponse_XMLFault_ExisteSeccion_True() { string response = File.ReadAllText(Path.Combine(path, @"Files\Response_Fault.xml")); XDocument xml = XDocument.Parse(response); var body = new SoapManager(null).ExtractValue(xml, "Envelope.Body"); var bodyCampo = new SoapManager(null).ExtractValue(xml, "Envelope.Body.ConsultarEstadosFolioCajaResponse.ResultadoOperacion.Codigo"); var header = new SoapManager(null).ExtractValue(xml, "Envelope.Header"); var headerCampo = new SoapManager(null).ExtractValue(xml, "Envelope.Header.Header.Transaccion.Canal"); var fault = new SoapManager(null).ExtractValue(xml, "Envelope.Body.Fault"); var faultCampo = new SoapManager(null).ExtractValue(xml, "Envelope.Body.Fault.faultcode"); Assert.AreEqual <bool>(body.IsExist, true); Assert.AreEqual <bool>(bodyCampo.Value == null, true); Assert.AreEqual <bool>(header.IsExist, false); Assert.AreEqual <bool>(headerCampo.Value == null, true); Assert.AreEqual <bool>(fault.IsExist, true); Assert.AreEqual <bool>(faultCampo.Value.Equals("soap:Server"), true); }