/// <summary> /// Creates an <see cref="ODataMessageReader"/> from the specified <paramref name="memoryStream"/>. /// </summary> /// <param name="memoryStream">The <see cref="MemoryStream"/> used as input for the message reader.</param> /// <returns>An <see cref="ODataMessageReader"/> instance.</returns> private ODataMessageReader CreateMessageReader(MemoryStream memoryStream) { // Create a test message around the memory stream, set the content-type header and then create // the message reader if (this.IsResponse) { TestResponseMessage responseMessage = new TestResponseMessage(memoryStream, TestMessageFlags.NoAsynchronous); responseMessage.SetHeader(ODataConstants.ContentTypeHeader, "multipart/mixed; boundary=" + this.BatchBoundary); return new ODataMessageReader(responseMessage); } else { TestRequestMessage requestMessage = new TestRequestMessage(memoryStream, TestMessageFlags.NoAsynchronous); requestMessage.SetHeader(ODataConstants.ContentTypeHeader, "multipart/mixed; boundary=" + this.BatchBoundary); return new ODataMessageReader(requestMessage); } }