public static void Test_Chain_Handler_Calls_Handle_Methods_On_Handlers_Multiple()
        {
            //arrange
            var chain = new ChainMessageHandlerStrategy<INetPeer, INetworkMessage>();

            Mock<IMessageHandler<INetPeer, INetworkMessage>> handler1 = new Mock<IMessageHandler<INetPeer, INetworkMessage>>();

            handler1.Setup(x => x.TryProcessMessage(It.IsAny<INetworkMessage>(), It.IsAny<IMessageParameters>(), It.IsAny<INetPeer>()))
                .Returns(false);

            Mock<IMessageHandler<INetPeer, INetworkMessage>> handler2 = new Mock<IMessageHandler<INetPeer, INetworkMessage>>();

            handler2.Setup(x => x.TryProcessMessage(It.IsAny<INetworkMessage>(), It.IsAny<IMessageParameters>(), It.IsAny<INetPeer>()))
                .Returns(false);

            //act
            bool result = chain.Register(handler1.Object);
            Assert.IsTrue(result, "Couldn't add a handler to the chain.");

            result = chain.Register(handler2.Object);
            Assert.IsTrue(result, "Couldn't add a handler to the chain.");

            chain.TryProcessMessage(Mock.Of<INetworkMessage>(), Mock.Of<IMessageParameters>(), Mock.Of<INetPeer>());

            //assert
            handler1.Verify(x => x.TryProcessMessage(It.IsAny<INetworkMessage>(), It.IsAny<IMessageParameters>(), It.IsAny<INetPeer>()), Times.Once());
            handler2.Verify(x => x.TryProcessMessage(It.IsAny<INetworkMessage>(), It.IsAny<IMessageParameters>(), It.IsAny<INetPeer>()), Times.Once());
        }
        public static void Test_Can_Add_New_Handler()
        {
            //arrange
            var chain = new ChainMessageHandlerStrategy<INetPeer, INetworkMessage>();
            Mock<IMessageHandler<INetPeer, INetworkMessage>> handler = new Mock<IMessageHandler<INetPeer, INetworkMessage>>();

            //act
            bool result = chain.Register(handler.Object);

            //assert
            Assert.IsTrue(result, "Couldn't add a handler to the chain.");
        }
        public static void Test_Indicates_Add_Failure_On_Null()
        {
            //arrange
            var chain = new ChainMessageHandlerStrategy<INetPeer, INetworkMessage>();

            //act
            bool result = chain.Register(null);

            //assert
            Assert.IsFalse(result, "Was able to add a null handler.");
        }