public void does_not_set_a_property_that_is_not_explicitly_configured() { var host = new HostManifest("h1"); host.RegisterSettings(data4); // the default value for Name is "somebody" host.GetDirective <OneDirective>().Name.ShouldEqual("somebody"); }
public void can_pull_setting_class_out_of_request_data() { var host = new HostManifest("host1"); host.RegisterSettings(data3); var directive = host.GetDirective <TwoDirective>(); directive.City.ShouldEqual("Austin"); directive.IsDomestic.ShouldBeTrue(); }
public void can_pull_setting_class_out_of_multiple_data_settings_with_no_conflict() { var host = new HostManifest("host1"); host.RegisterSettings(data1); host.RegisterSettings(data4); var directive = host.GetDirective <OneDirective>(); directive.Name.ShouldEqual("Max"); directive.Age.ShouldEqual(7); }
public void append_host_respects_setting_order() { var host1 = new HostManifest("h1"); host1.RegisterSettings(data4); var host2 = new HostManifest("h2"); host2.RegisterSettings(data5); host1.Append(host2); host1.GetDirective<OneDirective>().Age.ShouldEqual(7); }
public void do_not_bind_complex_child_if_no_data_exists() { var host = new HostManifest("host1"); var data = new SettingsData() .With("ComplexDirective.One.Name", "Thurgood") .With("ComplexDirective.One.Age", "57"); host.RegisterSettings(data); var complex = host.GetDirective <ComplexDirective>(); complex.One.ShouldNotBeNull(); complex.Two.ShouldBeNull(); }
public void append_host_respects_setting_order() { var host1 = new HostManifest("h1"); host1.RegisterSettings(data4); var host2 = new HostManifest("h2"); host2.RegisterSettings(data5); host1.Append(host2); host1.GetDirective <OneDirective>().Age.ShouldEqual(7); }
public void respects_ordering_of_setting_data() { var host1 = new HostManifest("h1"); host1.RegisterSettings(data4); host1.RegisterSettings(data5); host1.GetDirective <OneDirective>().Age.ShouldEqual(7); var host2 = new HostManifest("h2"); host2.RegisterSettings(data5); host2.RegisterSettings(data4); host2.GetDirective <OneDirective>().Age.ShouldEqual(8); }
public void can_pull_complex_settings() { var host = new HostManifest("host1"); var data = new SettingsData() .With("ComplexDirective.One.Name", "Thurgood") .With("ComplexDirective.One.Age", "57") .With("ComplexDirective.Two.City", "Joplin"); host.RegisterSettings(data); var complex = host.GetDirective <ComplexDirective>(); complex.One.Name.ShouldEqual("Thurgood"); complex.One.Age.ShouldEqual(57); complex.Two.City.ShouldEqual("Joplin"); }
public void can_pull_complex_settings() { var host = new HostManifest("host1"); var data = new SettingsData() .With("ComplexDirective.One.Name", "Thurgood") .With("ComplexDirective.One.Age", "57") .With("ComplexDirective.Two.City", "Joplin"); host.RegisterSettings(data); var complex = host.GetDirective<ComplexDirective>(); complex.One.Name.ShouldEqual("Thurgood"); complex.One.Age.ShouldEqual(57); complex.Two.City.ShouldEqual("Joplin"); }
public void respects_ordering_of_setting_data() { var host1 = new HostManifest("h1"); host1.RegisterSettings(data4); host1.RegisterSettings(data5); host1.GetDirective<OneDirective>().Age.ShouldEqual(7); var host2 = new HostManifest("h2"); host2.RegisterSettings(data5); host2.RegisterSettings(data4); host2.GetDirective<OneDirective>().Age.ShouldEqual(8); }
public void do_not_bind_complex_child_if_no_data_exists() { var host = new HostManifest("host1"); var data = new SettingsData() .With("ComplexDirective.One.Name", "Thurgood") .With("ComplexDirective.One.Age", "57"); host.RegisterSettings(data); var complex = host.GetDirective<ComplexDirective>(); complex.One.ShouldNotBeNull(); complex.Two.ShouldBeNull(); }
public void does_not_set_a_property_that_is_not_explicitly_configured() { var host = new HostManifest("h1"); host.RegisterSettings(data4); // the default value for Name is "somebody" host.GetDirective<OneDirective>().Name.ShouldEqual("somebody"); }
public void can_pull_setting_class_out_of_request_data() { var host = new HostManifest("host1"); host.RegisterSettings(data3); var directive = host.GetDirective<TwoDirective>(); directive.City.ShouldEqual("Austin"); directive.IsDomestic.ShouldBeTrue(); }
public void can_pull_setting_class_out_of_multiple_data_settings_with_no_conflict() { var host = new HostManifest("host1"); host.RegisterSettings(data1); host.RegisterSettings(data4); var directive = host.GetDirective<OneDirective>(); directive.Name.ShouldEqual("Max"); directive.Age.ShouldEqual(7); }