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]); } }
private static IMessageFactory GetMessageFactory(Channel channel) { Contract.Requires <ArgumentNullException>(channel != null); Channel_Accessor accessor = Channel_Accessor.AttachShadow(channel); return(accessor.MessageFactory); }
public void TooManyBindingElementsProvidingSameProtection() { Channel channel = new TestChannel( new TestMessageFactory(), new MockSigningBindingElement(), new MockSigningBindingElement()); Channel_Accessor accessor = Channel_Accessor.AttachShadow(channel); accessor.ProcessOutgoingMessage(new TestSignedDirectedMessage()); }
protected override void ProcessIncomingMessage(IProtocolMessage message) { Channel_Accessor accessor = Channel_Accessor.AttachShadow(this.wrappedChannel); accessor.ProcessIncomingMessage(message); }
protected override IDictionary <string, string> ReadFromResponseCore(IncomingWebResponse response) { Channel_Accessor accessor = Channel_Accessor.AttachShadow(this.wrappedChannel); return(accessor.ReadFromResponseCore(response)); }