예제 #1
0
        public static void AddHandlerExceptionsPipelines_Should_Add_Pipelines()
        {
            // arrange
            var pipelines = new Pipelines();
            var container = new TinyIoCContainer();

            container.Register <ICommunicationLogger, CommunicationLoggerMock>();
            container.Register(JsonUtility.CamelCaseJsonSerializerSettings);
            var context = NancyContextMock.Create();

            // act
            pipelines.AddHandlerExceptionsPipelines(container);
            pipelines.OnError.Invoke(context, null);

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