public IRequestData DataFor(string source) { var dictionary = new AggregateDictionary(); var locator = findLocator(source); dictionary._locators.Add(locator); return new RequestData(dictionary); }
public static AggregateDictionary ForHttpContext(HttpContextWrapper context) { var dict = new AggregateDictionary(); dict.configureForRequest(context); return(dict); }
public IRequestData DataFor(string source) { var dictionary = new AggregateDictionary(); var locator = findLocator(source); dictionary._locators.Add(locator); return(new RequestData(dictionary)); }
public static string FindPath(AggregateDictionary dictionary) { var routeData = dictionary.DataFor(RequestDataSource.Route.ToString()); var list = new List<string>(); for (var i = 0; i < 10; i++) { routeData.Value("Part" + i, o => list.Add(o.ToString())); } return list.Join("/"); }
public void value_from_a_specific_locator() { var dictionary = new AggregateDictionary(); dictionary.AddDictionary("Headers", new Dictionary<string, object>{ {"key1", 1}, {"key2", 2}, {"key3", 3}, {"key4", 4}, }); dictionary.AddDictionary("Post", new Dictionary<string, object>{ {"key1", 11}, {"key2", 22}, {"key3", 33}, {"key4", 44}, }); dictionary.AddDictionary("Querystring", new Dictionary<string, object>{ {"key1", 111}, {"key2", 222}, {"key3", 333}, {"key4", 444}, }); object lastNumber = null; Action<string, object> callback = (s, o) => lastNumber = o; dictionary.Value("Headers", "key2", callback); lastNumber.ShouldEqual(2); dictionary.Value("Post", "key2", callback); lastNumber.ShouldEqual(22); dictionary.Value("Querystring", "key2", callback); lastNumber.ShouldEqual(222); }
public RecordingRequestData(IDebugReport report, AggregateDictionary dictionary) : base(dictionary) { _report = report; }
public static RequestData ForDictionary(IDictionary<string, object> dictionary) { AggregateDictionary dict = new AggregateDictionary().AddDictionary(dictionary); return new RequestData(dict); }
public RequestData(AggregateDictionary dictionary) { _dictionary = dictionary; }
public static AggregateDictionary ForHttpContext(HttpContextWrapper context) { var dict = new AggregateDictionary(); dict.configureForRequest(context); return dict; }
public static RequestData ForDictionary(IDictionary <string, object> dictionary) { AggregateDictionary dict = new AggregateDictionary().AddDictionary(dictionary); return(new RequestData(dict)); }
public bool Matches(PropertyInfo property) { return(AggregateDictionary.IsSystemProperty(property)); }
public void SetUp() { theBinder = StandardModelBinder.Basic().As<StandardModelBinder>(); theAggregateDictionary = new AggregateDictionary(); var otherDictionary = new Dictionary<string, object>(); for (int i = 0; i < 10; i++) { otherDictionary.Add("Part" + i, Guid.NewGuid().ToString()); } theAggregateDictionary.AddDictionary(RequestDataSource.Request.ToString(), otherDictionary); theRouteValues = new Dictionary<string, object>(); theAggregateDictionary.AddDictionary(RequestDataSource.Route.ToString(), theRouteValues); }