コード例 #1
0
        public void TestRemoveHeaderEvenIfNull()
        {
            IMessage <string> message = new GenericMessage <string>("payload", SingletonMap("foo", null));
            var accessor = new MessageHeaderAccessor(message);

            accessor.RemoveHeader("foo");
            var headers = accessor.ToDictionary();

            Assert.False(headers.ContainsKey("foo"));
        }
コード例 #2
0
        public void TestRemoveHeader()
        {
            IMessage message  = Message.Create <string>("payload", SingletonMap("foo", "bar"));
            var      accessor = new MessageHeaderAccessor(message);

            accessor.RemoveHeader("foo");
            var headers = accessor.ToDictionary();

            Assert.False(headers.ContainsKey("foo"));
        }