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); }
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); }