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)); }