public IEnumerable <SettingsData> FindSettingData() { var data = new SettingsData(); data.Child("FooSettings").Set("Name", "Max"); data.Child("FooSettings").Set("Age", "9"); data.Child("BarSettings").Set("Direction", "North"); yield return(data); }
public SettingsData GetParentSource(SettingsData source) { ParentParts.Each(x => { if (x.Contains("[")) { var parts = x.TrimEnd(']').Split('['); var index = int.Parse(parts.Last()); source = source.GetChildrenElement(parts.First(), index); } else { source = source.Child(x); } }); return(source); }
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 has_setting_positive() { theSettings.Child("WebsiteSettings").Has("DiagnosticsEnabled").ShouldBeTrue(); }