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 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) { _sources.Each(source => { report.StartSource(source); source.WriteReport(report); report.EndSource(); }); }
public void simple_value() { theReport = MockRepository.GenerateMock <IValueReport>(); theSource.Set("A", 1); theSource.WriteReport(theReport); theReport.AssertWasCalled(x => x.Value("A", 1)); }
public void simple_value() { theReport = MockRepository.GenerateMock<IValueReport>(); theSource.Set("A", 1); theSource.WriteReport(theReport); theReport.AssertWasCalled(x => x.Value("A", 1)); }
public void WriteReport(IValueReport report) { _request.AllHeaderKeys().Each(key => { report.Value(key, Get(key)); }); }
public void SetUp() { theMocks = new MockRepository(); theSource = new SettingsData(new Dictionary <string, object>(), "Something"); theReport = theMocks.StrictMock <IValueReport>(); }
public void WriteReport(IValueReport report) { // no-op }
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) { _keys.Value.Each(key => report.Value(key, Get(key))); }
public void SetUp() { theMocks = new MockRepository(); theSource = new SettingsData(new Dictionary<string, object>(), "Something"); theReport = theMocks.StrictMock<IValueReport>(); }
public void WriteReport(IValueReport report) { _values.GetKeys().ToList().Each(x => report.Value(x, _values.Get(x))); }
public void WriteReport(IValueReport report) { _inner.WriteReport(report); }
public void WriteReport(IValueReport report) { _systemProperties.Each(prop => report.Value(prop.Name, Get(prop.Name))); }
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) { _cookies.All.Where(x => x.Value.IsNotEmpty()).Each(x => { report.Value(x.States.First().Name, x.Value); }); }