public void SetHandlerSuccessor_WhenSetSuccessorIsCalled() { var concreteHandlerOne = new ConcreteHandlerOne(); var concreteHandlerTwo = new ConcreteHandlerTwo(); concreteHandlerOne.SetSuccessor(concreteHandlerTwo); concreteHandlerOne.Successor.Should().Be(concreteHandlerTwo); }
public void ReturnOneForRequestsOfTypeOne_WhenHandleRequestIsCalled() { var requestType = 1; var expectedConcreteHandlerNumber = 1; var concreteHandlerOne = new ConcreteHandlerOne(); var handledBy = concreteHandlerOne.Handle(requestType); handledBy.Should().Be(expectedConcreteHandlerNumber); }
public void ReturnMinusOneIfSuccessorIsNotSet_WhenHandleRequestIsCalled() { var requestType = 2; var expectedConcreteHandlerNumber = -1; var concreteHandlerOne = new ConcreteHandlerOne(); var handledBy = concreteHandlerOne.Handle(requestType); handledBy.Should().Be(expectedConcreteHandlerNumber); }
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); }