private static bool CheckStringSiteOptionChanged(List<SiteOption> updatedOptions, Dictionary<string, string[]> values, SiteOption so, string key, bool optionChanged, SiteOption update)
 {
     String newValue = (String)values[key].GetValue(0);
     if (update.GetValueString() != newValue)
     {
         update.SetValueString(newValue);
         updatedOptions.Add(update);
         optionChanged = true;
     }
     return optionChanged;
 }
示例#2
0
        public void SetValueString_NotStringType_ThrowsException()
        {
            string section = string.Empty;
            string name = string.Empty;
            string value = "1";
            SiteOption.SiteOptionType type = SiteOption.SiteOptionType.Bool;
            string description = string.Empty;
            SiteOption target = new SiteOption(DEFAULT_SITE_ID, section, name, value, type, description);

            try
            {
                target.SetValueString("test");
                throw new Exception("SetValueString should throw exception");
            }
            catch (SiteOptionInvalidTypeException)
            {
            }
        }