Esempio n. 1
0
        /// <summary>
        /// Initializes the static instance of a <see cref="ControlAdaptersConfiguration"/> by reading
        /// the <c>ControlAdapters</c> section of the application's configuration file.
        /// </summary>
        static ControlAdaptersConfiguration()
        {
            _config = ConfigurationManager.GetSection("ControlAdapters") as ControlAdaptersConfigurationSection;

            if (_config == null)
            {
                _config = new ControlAdaptersConfigurationSection();
            }
        }
        /// <summary>
        /// Initializes the static instance of a <see cref="ControlAdaptersConfiguration"/> by reading
        /// the <c>ControlAdapters</c> section of the application's configuration file.
        /// </summary>
        static ControlAdaptersConfiguration()
        {
            _config = ConfigurationManager.GetSection("ControlAdapters") as ControlAdaptersConfigurationSection;

             if (_config == null)
             {
                 _config = new ControlAdaptersConfigurationSection();
             }
        }
        public void TestAppConfigSection()
        {
            config = ConfigurationManager.GetSection("ControlAdapters") as ControlAdaptersConfigurationSection;
            Assert.IsNotNull(config, "Unable to read ControlAdapters section from application configuration file");

            CheckBoxListSettings checkBoxSettings = config.CheckBoxList;
            Assert.IsNotNull(checkBoxSettings, "Unable to read CheckBoxList section");
            Assert.AreEqual(checkBoxSettings.CssClass, "checkBoxList", "CheckBoxList CssClass not set properly");
            Assert.AreEqual(checkBoxSettings.DisabledCssClass, "disabled", "CheckBoxList DisabledCssClass not set properly");
        }