コード例 #1
0
        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);
        }
コード例 #2
0
        private void WriteTopLevelEntry(ODataMessageWriterTestWrapper messageWriter, ODataEntry entry)
        {
            ExceptionUtilities.CheckArgumentNotNull(messageWriter, "messageWriter");
            ODataWriter entryWriter = messageWriter.CreateODataEntryWriter();

            this.WriteEntry(entryWriter, entry);

            entryWriter.Flush();
        }
コード例 #3
0
        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");
            }
            ;
        }