public void AmbientSettingsWithSetNameNull()
        {
            string settingName           = nameof(AmbientSettingsWithSetNameNull) + "-int-setting";
            AmbientSetting <int> setting = new AmbientSetting <int>(settingName, "", s => Int32.Parse(s), "1");

            (int, string)valueWithSetName = setting.GetValueWithSetName();
        }
        public void AmbientSettingsWithSetName()
        {
            string settingName            = nameof(AmbientSettingsWithSetName) + "-int-setting";
            AmbientSetting <int> setting3 = new AmbientSetting <int>(settingName, "", s => Int32.Parse(s), "1");

            Assert.AreEqual(1, setting3.Value);
            Assert.IsNotNull(setting3.GetValueWithSetName().Item2);
            IMutableAmbientSettingsSet settingsSet = _SettingsSet.Global as IMutableAmbientSettingsSet;

            if (settingsSet != null)
            {
                settingsSet.ChangeSetting(settingName, "2");
                Assert.AreEqual(2, setting3.Value);
                Assert.AreEqual(BasicAmbientSettingsSet.DefaultSetName, setting3.GetValueWithSetName().Item2);
            }
            // use a local override in case we ran another test that left the global or local settings set set to something else on this thread
            BasicAmbientSettingsSet settings = new BasicAmbientSettingsSet(nameof(AmbientSettingsWithSetName));

            using (ScopedLocalServiceOverride <IAmbientSettingsSet> localOverrideTest = new ScopedLocalServiceOverride <IAmbientSettingsSet>(settings))
            {
                AmbientSetting <int> setting;
                setting = new AmbientSetting <int>(nameof(AmbientSettingsWithSetName) + "-int-setting-1", "", s => string.IsNullOrEmpty(s) ? 0 : Int32.Parse(s));
                Assert.AreEqual(0, setting.Value);
                Assert.IsNotNull(setting.GetValueWithSetName().Item2);
                setting = new AmbientSetting <int>(nameof(AmbientSettingsWithSetName) + "-int-setting-2", "", s => Int32.Parse(s), "1");
                settings.ChangeSetting(nameof(AmbientSettingsWithSetName) + "-int-setting-2", "1");
                Assert.AreEqual(1, setting.Value);
                Assert.AreEqual(nameof(AmbientSettingsWithSetName), setting.GetValueWithSetName().Item2);
                setting = new AmbientSetting <int>(settingName, "", s => Int32.Parse(s), "1");
                settings.ChangeSetting(settingName, "3");
                Assert.AreEqual(3, setting3.Value);
                Assert.AreEqual(nameof(AmbientSettingsWithSetName), setting3.GetValueWithSetName().Item2);

                // test changing the setting to null so we fall through to the global settings set
                settings.ChangeSetting(settingName, null);
                int settingValue = setting.Value;
                Assert.AreEqual(1, setting.Value);
                Assert.IsNotNull(setting3.GetValueWithSetName().Item2);
            }
        }