コード例 #1
0
        public void add_a_second_handler_for_a_concrete_class_appends_to_the_chain()
        {
            theGraph.Add(concreteCall);
            theGraph.Add(concreteCall2);
            theGraph.Add(concreteCall3);

            theGraph.ShouldHaveCount(1);

            var calls = theGraph.ChainFor(typeof(Input)).OfType <HandlerCall>().ToArray();

            calls.ShouldHaveCount(3);
            var firstCall = calls.ElementAt(0).ShouldBeOfType <HandlerCall>();

            firstCall.Equals(concreteCall).ShouldBeTrue();

            calls.ElementAt(0).ShouldNotBeTheSameAs(concreteCall);

            calls.ElementAt(1).Equals(concreteCall2).ShouldBeTrue();
            calls.ElementAt(1).ShouldNotBeTheSameAs(concreteCall2);
        }