public void Test_SaveTextAppService_OverHttp_Save_WithValidationMessages() { try { string url = "http://localhost:6371/savetextappservice.svc"; string soapAction = "http://tempuri.org/ISaveTextAppService/Save"; byte[] dataToSend = EmbeddedResourceHelper.GetEmbeddedResourceBytes( Assembly.GetExecutingAssembly(), "TestResources", "Save_WithValidationMessages.xml"); HttpWebRequest request = CreateSoapRequest(url, soapAction, dataToSend); using (var response = (HttpWebResponse)request.GetResponse()) { using (Stream responseStream = response.GetResponseStream()) { if (responseStream == null) { throw new NullException(nameof(responseStream)); } using (var reader = new StreamReader(responseStream, Encoding.UTF8)) { string dataReceived = reader.ReadToEnd(); SaveTextViewModel viewModel = ParseReceivedData(dataReceived); } } } } catch (WebException ex) { Assert.Inconclusive(ex.Message); } }
private byte[] GetBytesToSendFromEmbeddedResource() => EmbeddedResourceHelper.GetEmbeddedResourceBytes( Assembly.GetExecutingAssembly(), "TestResources", "Save.xml");