Example #1
0
        public void TrySetValue3()
        {
            foreach (var cur in _settings.AllSettings)
            {
                SettingValue value = null;
                if (cur.Kind.IsToggleKind)
                {
                    value = SettingValue.NewToggleValue(true);
                }
                else if (cur.Kind.IsStringKind)
                {
                    value = SettingValue.NewStringValue("foo");
                }
                else if (cur.Kind.IsNumberKind)
                {
                    value = SettingValue.NewNumberValue(42);
                }
                else
                {
                    throw new Exception("failed");
                }

                Assert.True(_settings.TrySetValue(cur.Abbreviation, value));
            }
        }
Example #2
0
        public void TrySetValue3()
        {
            var settings = Create();

            foreach (var cur in settings.AllSettings)
            {
                SettingValue value = null;
                if (cur.Kind.IsToggleKind)
                {
                    value = SettingValue.NewToggleValue(true);
                }
                else if (cur.Kind.IsStringKind)
                {
                    value = SettingValue.NewStringValue("foo");
                }
                else if (cur.Kind.IsNumberKind)
                {
                    value = SettingValue.NewNumberValue(42);
                }
                else
                {
                    Assert.Fail();
                }

                Assert.IsTrue(settings.TrySetValue(cur.Abbreviation, value));
            }
        }
        public void CaretOpacity1()
        {
            _caret.SetupSet(x => x.CaretOpacity = 0.01d).Verifiable();
            var setting = new Setting(
                GlobalSettingNames.CaretOpacityName,
                "",
                SettingKind.StringKind,
                SettingValue.NewStringValue(""),
                SettingValue.NewStringValue(""),
                true);

            _settings.SetupGet(x => x.CaretOpacity).Returns(1);
            _settings.Raise(x => x.SettingChanged += null, null, new SettingEventArgs(setting));
            _caret.Verify();
        }