public EndpointReference DeserializeCreateResponse(IncomingMessage createResponseMessage) { var reader = createResponseMessage.GetReaderAtBodyContents(); reader.ReadStartElement(Constants.CreateResponse_ResourceCreatedElement, Constants.Namespace); var result = new EndpointReference(); result.ReadXml(reader); reader.ReadEndElement(); return result; }
private static EndpointReference DeserializeCreateResponse(IncomingMessage createResponseMessage) { var reader = createResponseMessage.GetReaderAtBodyContents(); reader.ReadStartElement(Constants.CreateResponse_ResourceCreatedElement, Constants.Namespace); var result = new EndpointReference(); result.ReadOuterXml(reader); return(result); }
public void It_throws_exception_when_trying_to_get_body_reader_when_body_is_empty() { var messageElement = new XElement(Constants.Envelope, new XElement(Constants.Header), new XElement(Constants.Body)); var messageReader = messageElement.ToReader(); var message = new IncomingMessage(messageReader); Assert.IsTrue(message.IsEmpty); var bodyReader = message.GetReaderAtBodyContents(); }
public void It_throws_exception_when_trying_to_get_body_reader_when_body_is_empty() { var messageElement = new XElement(Constants.Envelope, new XElement(Constants.Header), new XElement(Constants.Body)); var messageReader = messageElement.ToReader(); var message = new IncomingMessage(messageReader); Assert.IsTrue(message.IsEmpty); var bodyReader = message.GetReaderAtBodyContents(); }
public void It_returns_reader_at_body_contents() { var messageElement = new XElement(Constants.Envelope, new XElement(Constants.Header), new XElement(Constants.Body, new XText("Text in the body"))); var messageReader = messageElement.ToReader(); var message = new IncomingMessage(messageReader); var bodyReader = message.GetReaderAtBodyContents(); Assert.IsFalse(message.IsEmpty); Assert.AreEqual(XmlNodeType.Text, bodyReader.NodeType); Assert.AreEqual("Text in the body", bodyReader.Value); }
public void It_returns_reader_at_body_contents() { var messageElement = new XElement(Constants.Envelope, new XElement(Constants.Header), new XElement(Constants.Body, new XText("Text in the body"))); var messageReader = messageElement.ToReader(); var message = new IncomingMessage(messageReader); var bodyReader = message.GetReaderAtBodyContents(); Assert.IsFalse(message.IsEmpty); Assert.AreEqual(XmlNodeType.Text, bodyReader.NodeType); Assert.AreEqual("Text in the body", bodyReader.Value); }