public void DefaultSettingsSource_GetValue_ReturnsDefaultValues() { var bool1Def = new BoolSettingDefinition("key1", "desc", true); var bool2Def = new BoolSettingDefinition("key2", "desc", false); var int1Def = new IntegerSettingDefinition("key3", "desc", 1); var int2Def = new IntegerSettingDefinition("key4", "desc", 0); var source = new DefaultSettingsSource(new ISettingDefinition[] { bool1Def, bool2Def, int1Def, int2Def }); Assert.AreEqual("True", source.GetValue("key1")); Assert.AreEqual("False", source.GetValue("key2")); Assert.AreEqual("1", source.GetValue("key3")); Assert.AreEqual("0", source.GetValue("key4")); }
public void DefaultSettingsSource_Constructor_CreateDefinitionDictionary() { var bool1Def = new BoolSettingDefinition("key1", "desc", true); var bool2Def = new BoolSettingDefinition("key2", "desc", false); var int1Def = new IntegerSettingDefinition("key3", "desc", 1); var int2Def = new IntegerSettingDefinition("key4", "desc", 0); var source = new DefaultSettingsSource(new ISettingDefinition[] { bool1Def, bool2Def, int1Def, int2Def }); Assert.IsNotNull(source.SettingDefinitions); Assert.AreEqual(4, source.SettingDefinitions.Count); Assert.AreEqual(bool1Def, source.SettingDefinitions["key1"]); Assert.AreEqual(bool2Def, source.SettingDefinitions["key2"]); Assert.AreEqual(int1Def, source.SettingDefinitions["key3"]); Assert.AreEqual(int2Def, source.SettingDefinitions["key4"]); }
public void DefaultSettingsSource_Scope_Application() { var source = new DefaultSettingsSource(new ISettingDefinition[] { }); Assert.AreEqual(SettingScopeEnum.Application, source.Scope); }