public void child_value_superceeds_the_parent() { theParent.Replace(new FakeSettings()); theSettings.Replace(new FakeSettings { Hometown = "Austin" }); theSettings.Get <FakeSettings>().ShouldNotBeTheSameAs(theParent.Get <FakeSettings>()); theSettings.Get <FakeSettings>().Hometown.ShouldEqual("Austin"); }
public void can_completely_replace_the_settings() { theSettings.Replace(new FakeSettings { Name = "Lindsey", Hometown = "San Antonio" }); theSettings.Get <FakeSettings>().ShouldEqual(new FakeSettings { Name = "Lindsey", Hometown = "San Antonio" }); }
public void visit_to_get_customizatinos() { var settings1 = new AppSettings(); var settings2 = new FakeSettings(); theSettings.Replace(settings1); theSettings.Replace(settings2); var visitor = MockRepository.GenerateMock <Action <Type, object> >(); theSettings.ForAllSettings(visitor); visitor.AssertWasCalled(x => x.Invoke(typeof(AppSettings), settings1)); visitor.AssertWasCalled(x => x.Invoke(typeof(FakeSettings), settings2)); }
public void pull_defaults_from_the_parent_if_it_exists_if_it_is_missing_in_child() { theParent.Replace(new FakeSettings()); theSettings.Get <FakeSettings>().ShouldBeTheSameAs(theParent.Get <FakeSettings>()); }