public List <PROCESS_BATCH> CallServiceGetProcessMatch() { #region metodos try { var client = new RestClient(routeBach); client.Authenticator = new HttpBasicAuthenticator(basicAuthUser, basicAuthPass); var request = new RestRequest(Method.POST); request.Resource = nameService2; request.RequestFormat = RestSharp.DataFormat.Json; request.AddHeader("Content-type", "application/json"); request.AddBody(new { }); IRestResponse response = client.Execute(request); ProcessBachDataMapper dataMapper = new ProcessBachDataMapper(); Dictionary <string, string> resx = dataMapper.GetResponseDictionary(response.Content); List <PROCESS_BATCH> list = new List <PROCESS_BATCH>(); if (resx != null) { list = dataMapper.GetDeserializeProcessBach(resx["GetProcessBachResult"]); } return(list); } catch (Exception) { throw; } #endregion }
public void GetJsonProcessBachTest() { ProcessBachDataMapper target = new ProcessBachDataMapper(); // TODO: Inicializar en un valor adecuado string expected = string.Empty; // TODO: Inicializar en un valor adecuado string actual; actual = target.GetJsonProcessBach(); Assert.AreEqual(expected, actual); Assert.Inconclusive("Compruebe la exactitud de este método de prueba."); }
public string GetProcessBach() { string respuesta = null; ProcessBachDataMapper dataMapper = new ProcessBachDataMapper(); respuesta = dataMapper.GetJsonProcessBach(); if (String.IsNullOrEmpty(respuesta)) { respuesta = null; } return(respuesta); }