示例#1
0
        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>()));
        }
示例#2
0
        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>()));
        }
示例#3
0
 public void SettingsGroupServiceCannotBeNull()
 {
     var settingsService = new TestSettingsGroup("Test", null);
 }
示例#4
0
 public void SettingsGroupKeyCannotBeNull()
 {
     var settingsService     = new Mock <ISettingsService>();
     TestSettingsGroup group = new TestSettingsGroup(null, settingsService.Object);
 }