private void WriteTopLevelFeed(ODataMessageWriterTestWrapper messageWriter, ODataMessageReaderTestWrapper messageReader, ODataResourceSet feed) { var feedWriter = messageWriter.CreateODataResourceSetWriter(); Lazy <ODataReader> lazyReader = new Lazy <ODataReader>(() => messageReader.CreateODataResourceSetReader()); this.WriteFeed(feedWriter, lazyReader, feed); }
private void WriteTopLevelFeed(ODataMessageWriterTestWrapper messageWriter, ODataResourceSet feed) { ExceptionUtilities.CheckArgumentNotNull(messageWriter, "messageWriter"); var feedWriter = messageWriter.CreateODataResourceSetWriter(); 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.Resource: this.StartRead(reader.CreateODataResourceReader(), writer.CreateODataResourceWriter()); break; case ODataPayloadKind.ResourceSet: this.StartRead(reader.CreateODataResourceSetReader(), writer.CreateODataResourceSetWriter()); break; default: throw new NotSupportedException("ObjectModelReadWriteStreamer currently supports only feed and entry"); } ; }