public void WriteReport(IValueReport report) { _dictionary.Keys.ToList().Each(key => { var value = _dictionary[key]; if (value is IDictionary <string, object> ) { report.StartChild(key); var child = Child(key); child.WriteReport(report); report.EndChild(); } else if (value is IEnumerable <IDictionary <string, object> > ) { var children = value.As <IEnumerable <IDictionary <string, object> > >() .Select(x => new SettingsData(x)) .ToList(); for (int i = 0; i < children.Count; i++) { report.StartChild(key, i); children[i].WriteReport(report); report.EndChild(); } } else { report.Value(key, value); } }); }
public void WriteReport(IValueReport report) { foreach (var pair in _jObject) { var key = pair.Key; pair.IfIs <JValue>(value => report.Value(key, value.Value <string>())); pair.IfIs <JObject>(jo => { report.StartChild(key); var child = new JObjectValues(jo); child.WriteReport(report); report.EndChild(); }); pair.IfIs <JArray>(ja => { int i = 0; foreach (JObject jo in ja.OfType <JObject>()) { report.StartChild(key, i); var child = new JObjectValues(jo); child.WriteReport(report); report.EndChild(); } }); } }
public void nested_child() { theSource.Child("Child").As <SettingsData>().Set("A", 1); using (theMocks.Ordered()) { theReport.StartChild("Child"); theReport.Value("A", 1); theReport.EndChild(); } theMocks.ReplayAll(); theSource.WriteReport(theReport); theMocks.VerifyAll(); }
public void WriteReport(IValueReport report) { _cookies.Request.Where(x => x.Value.IsNotEmpty()).Each(x => { report.Value(x.States.First().Name, x.Value); }); }
public void WriteReport(IValueReport report) { _systemProperties.Each(prop => report.Value(prop.Name, Get(prop.Name))); }
public void WriteReport(IValueReport report) { _request.AllHeaderKeys().Each(key => { report.Value(key, Get(key)); }); }
public void WriteReport(IValueReport report) { _request.AllHeaderKeys().Each(key => { report.Value(key, Get(key)); }); }
public void WriteReport(IValueReport report) { _cookies.All.Where(x => x.Value.IsNotEmpty()).Each(x => { report.Value(x.States.First().Name, x.Value); }); }
public void WriteReport(IValueReport report) { _dictionary.Keys.ToList().Each(key => { var value = _dictionary[key]; if (value is IDictionary<string, object>) { report.StartChild(key); var child = Child(key); child.WriteReport(report); report.EndChild(); } else if (value is IEnumerable<IDictionary<string, object>>) { var children = value.As<IEnumerable<IDictionary<string, object>>>() .Select(x => new SettingsData(x)) .ToList(); for (int i = 0; i < children.Count; i++) { report.StartChild(key, i); children[i].WriteReport(report); report.EndChild(); } } else { report.Value(key, value); } }); }
public void WriteReport(IValueReport report) { _systemProperties.Each(prop => report.Value(prop.Name, Get(prop.Name))); }
public void WriteReport(IValueReport report) { _keys.Value.Each(key => report.Value(key, Get(key))); }
public void WriteReport(IValueReport report) { _values.GetKeys().ToList().Each(x => report.Value(x, _values.Get(x))); }
public void WriteReport(IValueReport report) { _keys.Value.Each(key => report.Value(key, Get(key))); }