Ejemplo n.º 1
0
        public void should_raise_exception_when_append_single_messagehandler_to_queued_handler()
        {
            DelegatingHandler[] handlers     = CreateHandlers(3);
            DelegatingHandler   handlerChain = CreateTopBottomHandler(handlers, true);
            var toAppend = new TestQueueHandler("appended");

            Assert.Throws <InvalidOperationException>(() => handlerChain.Append(toAppend), "should not be able to add two chains with queue");
        }
Ejemplo n.º 2
0
        public void i_can_append_single_messagehandler_to_not_queued_handler()
        {
            DelegatingHandler[] handlers     = CreateHandlers(3);
            DelegatingHandler   handlerChain = CreateTopBottomHandler(handlers);
            var toAppend = new TestQueueHandler("appended");

            handlerChain.Append(toAppend);
            Assert.AreEqual(toAppend, handlers.Last().InnerHandler, "handler has not been appended");
        }
Ejemplo n.º 3
0
 public static bool AreEqual(TestQueueHandler lhs, TestQueueHandler rhs)
 {
     if (ReferenceEquals(lhs, rhs))
     {
         return(true);
     }
     if (lhs == null || rhs == null)
     {
         return(false);
     }
     return(String.Equals(lhs.Name, rhs.Name, StringComparison.Ordinal));
 }