Exemple #1
0
        public void raise_indexOutOfRangeException_when_reaching_handler_out_of_depth()
        {
            DelegatingHandler[] handlers     = CreateHandlers(3);
            DelegatingHandler   handlerChain = CreateTopBottomHandler(handlers);

            Assert.Throws <IndexOutOfRangeException>(() => handlerChain.Inner(5), $"should raise an exception when trying to reach handler out of range");
        }
Exemple #2
0
        public void i_can_reach_handler_at_depth([Values(0, 1, 2, 3, 4)] int depth)
        {
            DelegatingHandler[] handlers     = CreateHandlers(5);
            DelegatingHandler   handlerChain = CreateTopBottomHandler(handlers);

            Assert.AreEqual(handlers[depth], handlerChain.Inner(depth), $"unexpected handler returned at depth {depth}");
        }