Beispiel #1
0
        public static void AddHandleSuccessfulRequestsPipelines_Should_Add_Pipelines()
        {
            // arrange
            var pipelines = new Pipelines();
            var container = new TinyIoCContainer();

            container.Register <ICommunicationLogger, CommunicationLoggerMock>();
            var context = NancyContextMock.Create(
                responseHeaders: new Dictionary <string, string>
            {
                { "Content-Type", "text/plain" }
            });

            // act
            pipelines.AddHandlerSuccessfulRequestsPipelines(container);
            pipelines.AfterRequest.Invoke(context, new CancellationToken());

            // assert
            Assert.Single(pipelines.AfterRequest.PipelineItems);
            Assert.Empty(pipelines.BeforeRequest.PipelineItems);
            Assert.Empty(pipelines.OnError.PipelineItems);
        }