public void registers_the_environment_dictionary_itself() { var environment = new Dictionary <string, object>(); var routeData = new RouteData(); var arguments = new OwinServiceArguments(routeData, environment); arguments.Get <IDictionary <string, object> >() .ShouldBeSameAs(environment); }
public void register_the_execution_log_if_it_exists() { var log = new ChainExecutionLog(); var environment = new Dictionary <string, object>(); environment.Log(log); var routeData = new RouteData(); var arguments = new OwinServiceArguments(routeData, environment); arguments.Get <IChainExecutionLog>() .ShouldBeSameAs(log); }
public string GenerateTextForCurrentThreadCulture() { var request = OwinHttpRequest.ForTesting(); request.ContentType(MimeType.HttpFormMimetype); request.Accepts(MimeType.Html.Value); var services = new OwinServiceArguments(new RouteData(), request.Environment); var invoker = new BehaviorInvoker(_parent._services, _chain); invoker.Invoke(services); var response = new OwinHttpResponse(request.Environment); return(response.Body.ReadAsText()); }