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