private void WriteTopLevelEntry(ODataMessageWriterTestWrapper messageWriter, ODataMessageReaderTestWrapper messageReader, ODataEntry entry) { ODataWriter entryWriter = messageWriter.CreateODataEntryWriter(); Lazy <ODataReader> lazyEntryReader = new Lazy <ODataReader>(() => messageReader.CreateODataEntryReader()); this.WriteEntry(entryWriter, lazyEntryReader, entry); }
private void WriteTopLevelEntry(ODataMessageWriterTestWrapper messageWriter, ODataEntry entry) { ExceptionUtilities.CheckArgumentNotNull(messageWriter, "messageWriter"); ODataWriter entryWriter = messageWriter.CreateODataEntryWriter(); this.WriteEntry(entryWriter, entry); entryWriter.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"); } ; }