public void Create_WithRequest_CallsMockContentServiceAndAssignsRequestResponsePairsOnNancyContextItem()
        {
            var request = new Request("GET", "/events", "HTTP");
            var requestResponsePairs = new List<ProviderServiceInteraction>
            {
                new ProviderServiceInteraction() { Request = new ProviderServiceRequest { Method = HttpVerb.Get, Path = "/events" }, Response = new ProviderServiceResponse() },
                new ProviderServiceInteraction() { Request = new ProviderServiceRequest { Method = HttpVerb.Post, Path = "/events" }, Response = new ProviderServiceResponse() },
            };

            var mockMockContextService = Substitute.For<IMockContextService>();
            var mockCultureService = Substitute.For<ICultureService>();
            var mockRequestTraceFactory = Substitute.For<IRequestTraceFactory>();
            var mockTextResource = Substitute.For<ITextResource>();

            mockMockContextService.GetExpectedRequestResponsePairs().Returns(requestResponsePairs);

            INancyContextFactory nancyContextFactory = new PactAwareContextFactory(
                mockMockContextService,
                mockCultureService,
                mockRequestTraceFactory,
                mockTextResource);

            var context = nancyContextFactory.Create(request);

            Assert.Equal(requestResponsePairs, context.Items["PactMockInteractions"]);
            mockMockContextService.Received(1).GetExpectedRequestResponsePairs();
        }
        public void Create_WithRequest_SetRequestOnContext()
        {
            var request = new Request("GET", "/events", "HTTP");

            var mockMockContextService = Substitute.For<IMockContextService>();
            var mockCultureService = Substitute.For<ICultureService>();
            var mockRequestTraceFactory = Substitute.For<IRequestTraceFactory>();
            var mockTextResource = Substitute.For<ITextResource>();

            INancyContextFactory nancyContextFactory = new PactAwareContextFactory(
                mockMockContextService,
                mockCultureService,
                mockRequestTraceFactory,
                mockTextResource);

            var context = nancyContextFactory.Create(request);

            Assert.Equal(request, context.Request);
        }