Esempio n. 1
0
        public void ReadFromResponse()
        {
            var fields = new Dictionary <string, string> {
                { "age", "15" },
                { "Name", "Andrew" },
                { "Location", "http://hostb/pathB" },
                { "Timestamp", XmlConvert.ToString(DateTime.UtcNow, XmlDateTimeSerializationMode.Utc) },
            };

            MemoryStream ms     = new MemoryStream();
            StreamWriter writer = new StreamWriter(ms);

            writer.Write(MessagingUtilities.CreateQueryString(fields));
            writer.Flush();
            ms.Seek(0, SeekOrigin.Begin);
            Channel_Accessor             channelAccessor    = Channel_Accessor.AttachShadow(this.channel);
            IDictionary <string, string> deserializedFields = channelAccessor.ReadFromResponseCore(new CachedDirectWebResponse {
                CachedResponseStream = ms
            });

            Assert.AreEqual(fields.Count, deserializedFields.Count);
            foreach (string key in fields.Keys)
            {
                Assert.AreEqual(fields[key], deserializedFields[key]);
            }
        }
        protected override IDictionary <string, string> ReadFromResponseCore(IncomingWebResponse response)
        {
            Channel_Accessor accessor = Channel_Accessor.AttachShadow(this.wrappedChannel);

            return(accessor.ReadFromResponseCore(response));
        }