public void ConstructorIfFinishRequestHandlersAreNullShouldThrowExceptionTest() { // Act & Assert var exception = Assert.Throws <ArgumentNullException>(() => new Pipeline <TestRequest, object>( Substitute.For <IRequestHandler <TestRequest, object> >(), PipelineTest.CreatePreRequestHandlers(), PipelineTest.CreatePostRequestHandlers(), null)); Assert.AreEqual("Value cannot be null. (Parameter 'finishRequestHandlers')", exception.Message); }
public void ConstructorIfRequestHandlerIsNullShouldThrowExceptionTest() { // Act & Assert var exception = Assert.Throws <ArgumentNullException>(() => new Pipeline <TestRequest, object>( null, PipelineTest.CreatePreRequestHandlers(), PipelineTest.CreatePostRequestHandlers(), PipelineTest.CreateFinishRequestHandlers())); Assert.AreEqual("Value cannot be null. (Parameter 'requestHandler')", exception.Message); }
public void ConstructorTest() { // Arrange & Act var pipeline = new Pipeline <TestRequest, object>( Substitute.For <IRequestHandler <TestRequest, object> >(), PipelineTest.CreatePreRequestHandlers(), PipelineTest.CreatePostRequestHandlers(), PipelineTest.CreateFinishRequestHandlers()); // Assert Assert.IsNotNull(pipeline); Assert.IsNotNull(pipeline.RequestHandler); Assert.IsNotEmpty(pipeline.PreRequestHandlers); Assert.IsNotEmpty(pipeline.PostRequestHandlers); Assert.IsNotEmpty(pipeline.FinishRequestHandlers); }