public void SettingStoreFiresSettingsServiceWithTheRightKey() { var settingsService = new Mock <ISettingsService>(); TestSettingsGroup group = new TestSettingsGroup("Prefix", settingsService.Object); group.SampleProperty = "test"; settingsService.Verify(s => s.SetSetting("Prefix_" + nameof(group.SampleProperty), It.IsAny <string>(), It.IsAny <SettingLocality>())); }
public void SettingRetrievalFiresSettingsServiceWithTheRightKey() { var settingsService = new Mock <ISettingsService>(); TestSettingsGroup group = new TestSettingsGroup("Prefix", settingsService.Object); var localProperty = group.SampleProperty; settingsService.Verify(s => s.GetSetting("Prefix_" + nameof(group.SampleProperty), It.IsAny <Func <string> >(), It.IsAny <SettingLocality>())); }
public void SettingsGroupServiceCannotBeNull() { var settingsService = new TestSettingsGroup("Test", null); }
public void SettingsGroupKeyCannotBeNull() { var settingsService = new Mock <ISettingsService>(); TestSettingsGroup group = new TestSettingsGroup(null, settingsService.Object); }