Ejemplo n.º 1
0
        public void RemoveHeaders()
        {
            IDictionary <string, object> map = new Dictionary <string, object>();

            map.Add("foo", "bar");
            map.Add("bar", "baz");
            var message  = new GenericMessage <string>("payload", map);
            var accessor = new MessageHeaderAccessor(message);

            accessor.RemoveHeaders("fo*");

            var actual = accessor.MessageHeaders;

            Assert.Equal(2, actual.Count);
            Assert.Null(actual.Get <string>("foo"));
            Assert.Equal("baz", actual.Get <string>("bar"));
        }
        public void RemoveHeaders()
        {
            IDictionary <string, object> map = new Dictionary <string, object>
            {
                { "foo", "bar" },
                { "bar", "baz" }
            };
            var message  = Message.Create <string>("payload", map);
            var accessor = new MessageHeaderAccessor(message);

            accessor.RemoveHeaders("fo*");

            var actual = accessor.MessageHeaders;

            Assert.Equal(2, ((HeadersDictionary)actual).Count);
            Assert.Null(actual.Get <string>("foo"));
            Assert.Equal("baz", actual.Get <string>("bar"));
        }