Esempio n. 1
0
        public void AddOrRemoveReservedHeaders()
        {
            var collection = new HeaderCollection();

            Assert.Throws<InvalidOperationException>(() => collection.AddHeader("message_id", "one-id"));
            Assert.Throws<InvalidOperationException>(() => collection.AddHeader("timestamp", 12345678L));

            Assert.Throws<InvalidOperationException>(() => collection.RemoveHeader("message_id"));
            Assert.Throws<InvalidOperationException>(() => collection.RemoveHeader("timestamp"));
        }
Esempio n. 2
0
        public void AddOrRemoveReservedHeaders()
        {
            var collection = new HeaderCollection();

            Assert.Throws<InvalidOperationException>(() => collection.AddHeader("message_id", "one-id"));
            Assert.Throws<InvalidOperationException>(() => collection.AddHeader("timestamp", 12345678L));
            Assert.Throws<InvalidOperationException>(() => collection.AddHeader("content_type", "application/json"));
            Assert.Throws<InvalidOperationException>(() => collection.AddHeader("content_encoding", "UTF-8"));
            Assert.Throws<InvalidOperationException>(() => collection.AddHeader("correlation_id", new Guid(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1).ToString()));
            Assert.Throws<InvalidOperationException>(() => collection.AddHeader("reply_to", "reply-queue-name"));
            Assert.Throws<InvalidOperationException>(() => collection.AddHeader("type", "urn:message:sample"));

            Assert.Throws<InvalidOperationException>(() => collection.RemoveHeader("message_id"));
            Assert.Throws<InvalidOperationException>(() => collection.RemoveHeader("timestamp"));
            Assert.Throws<InvalidOperationException>(() => collection.RemoveHeader("content_type"));
            Assert.Throws<InvalidOperationException>(() => collection.RemoveHeader("content_encoding"));
            Assert.Throws<InvalidOperationException>(() => collection.RemoveHeader("correlation_id"));
            Assert.Throws<InvalidOperationException>(() => collection.RemoveHeader("reply_to"));
            Assert.Throws<InvalidOperationException>(() => collection.RemoveHeader("type"));
        }
Esempio n. 3
0
        public void AddOrRemoveReservedHeaders()
        {
            var collection = new HeaderCollection();

            Assert.Throws<InvalidOperationException>(() => collection.AddHeader("message_id", "one-id"));
            Assert.Throws<InvalidOperationException>(() => collection.AddHeader("timestamp", 12345678L));
            Assert.Throws<InvalidOperationException>(() => collection.AddHeader("content_type", "application/json"));
            Assert.Throws<InvalidOperationException>(() => collection.AddHeader("content_encoding", "UTF-8"));

            Assert.Throws<InvalidOperationException>(() => collection.RemoveHeader("message_id"));
            Assert.Throws<InvalidOperationException>(() => collection.RemoveHeader("timestamp"));
            Assert.Throws<InvalidOperationException>(() => collection.RemoveHeader("content_type"));
            Assert.Throws<InvalidOperationException>(() => collection.RemoveHeader("content_encoding"));
        }