private static ApiOperationContext GetContext <T>( TestApiOperationExecutor executor, Dictionary <string, string> cookies) { var context = executor.HttpContextFor <T>(); var cookiesAsHeader = cookies.Select(c => $"{c.Key}={c.Value}").ToArray(); context.GetHttpContext().Request.Headers["Cookie"] = cookiesAsHeader; return(context); }
private static ApiOperationContext GetContext <T>( TestApiOperationExecutor executor, Dictionary <string, string> headers) { return(executor.HttpContextFor <T>(ctx => { foreach (var h in headers) { ctx.Request.Headers[h.Key] = h.Value; } })); }
private static ApiOperationContext GetContext <T>( TestApiOperationExecutor executor, Dictionary <string, string> headers) { var context = executor.HttpContextFor <T>(); foreach (var h in headers) { context.GetHttpContext().Request.Headers[h.Key] = h.Value; } return(context); }
private static ApiOperationContext GetContext <T>(TestApiOperationExecutor executor, string queryString) { return(executor.HttpContextFor <T>(ctx => ctx.Request.QueryString = new QueryString(queryString))); }