private void WriteTopLevelFeed(ODataMessageWriterTestWrapper messageWriter, ODataMessageReaderTestWrapper messageReader, ODataFeed feed) { var feedWriter = messageWriter.CreateODataFeedWriter(); Lazy <ODataReader> lazyReader = new Lazy <ODataReader>(() => messageReader.CreateODataFeedReader()); this.WriteFeed(feedWriter, lazyReader, feed); }
private void WriteTopLevelFeed(ODataMessageWriterTestWrapper messageWriter, ODataFeed feed) { ExceptionUtilities.CheckArgumentNotNull(messageWriter, "messageWriter"); var feedWriter = messageWriter.CreateODataFeedWriter(); this.WriteFeed(feedWriter, feed); feedWriter.Flush(); }
public void StreamMessage(ODataMessageReaderTestWrapper reader, ODataMessageWriterTestWrapper writer, ODataPayloadKind payloadKind, WriterTestConfiguration config) { ExceptionUtilities.CheckArgumentNotNull(reader, "reader is required"); ExceptionUtilities.CheckArgumentNotNull(writer, "writer is required"); ExceptionUtilities.CheckArgumentNotNull(payloadKind, "payloadKind is required"); ExceptionUtilities.CheckArgumentNotNull(config, "config is required"); this.testConfiguration = config; switch (payloadKind) { case ODataPayloadKind.Entry: this.StartRead(reader.CreateODataEntryReader(), writer.CreateODataEntryWriter()); break; case ODataPayloadKind.Feed: this.StartRead(reader.CreateODataFeedReader(), writer.CreateODataFeedWriter()); break; default: throw new NotSupportedException("ObjectModelReadWriteStreamer currently supports only feed and entry"); } ; }