Ejemplo n.º 1
0
        public static ScenarioAssertionException Run(IScenarioAssertion assertion,
                                                     Action <HttpContext> configuration)
        {
            var ex = new ScenarioAssertionException();

            var context = StubHttpContext.Empty();


            configuration(context);

            var stream = context.Response.Body;

            stream.Position = 0;

            assertion.Assert(null, context, ex);

            return(ex);
        }
Ejemplo n.º 2
0
        public static ScenarioAssertionException Run(IScenarioAssertion assertion,
                                                     Action <HttpContext> configuration)
        {
            var ex      = new ScenarioAssertionException();
            var support = new BasicScenarioSupport();

            var scenario = new Scenario(support, Substitute.For <IServiceScope>());

            configuration(scenario.Context);

            var stream = scenario.Context.Response.Body;

            if (stream != null)
            {
                stream.Position = 0;
            }

            assertion.Assert(scenario, ex);

            return(ex);
        }
Ejemplo n.º 3
0
        // holds on to the http context & IApplicationServer


        public Scenario AssertThat(IScenarioAssertion assertion)
        {
            _assertions.Add(assertion);

            return(this);
        }