Esempio n. 1
0
        public void SetHandlerSuccessor_WhenSetSuccessorIsCalled()
        {
            var concreteHandlerOne = new ConcreteHandlerOne();
            var concreteHandlerTwo = new ConcreteHandlerTwo();

            concreteHandlerOne.SetSuccessor(concreteHandlerTwo);

            concreteHandlerOne.Successor.Should().Be(concreteHandlerTwo);
        }
Esempio n. 2
0
        public void ReturnTwoForRequestsOfTypeTwo_WhenHandleRequestIsCalled()
        {
            var requestType = 2;
            var expectedConcreteHandlerNumber = 2;
            var concreteHandlerOne            = new ConcreteHandlerOne();
            var concreteHandlerTwo            = new ConcreteHandlerTwo();

            concreteHandlerOne.SetSuccessor(concreteHandlerTwo);

            var handledBy = concreteHandlerOne.Handle(requestType);

            handledBy.Should().Be(expectedConcreteHandlerNumber);
        }