示例#1
0
        public void VerifyRegistration()
        {
            AppConfig appconfig = new AppConfig(GetType().Name);

            appconfig.RegisterConfigSupplier(config);

            Assert.AreEqual("value", appconfig["simple.property"]);
        }
        public void VerifyRegistration()
        {
            AppConfig appconfig = new AppConfig(GetType().Name);

            appconfig.RegisterConfigSupplier(config);

            string s = Environment.GetEnvironmentVariable("TEST_DATA_DIR");

            Assert.AreEqual(s, appconfig["TEST_DATA_DIR"]);
        }
        public void VerifyRegistration()
        {
            AppConfig appconfig = new AppConfig("myapp");

            appconfig.RegisterConfigSupplier(config);

// FIXME:  bug in the appconfig class when resolving the mixed-case
// name...
//Serializer.WriteConfigAsProperties(Console.Out, appconfig);
            Assert.AreEqual(config.AppName, appconfig.AppName);
            Assert.AreEqual("mmdrv.dll",
                            appconfig["windows.drivers.wave"]);
        }
示例#4
0
        //////////////////////////////////////////////////////////////
        /// <summary>
        ///   This method is used to register a config supplier.
        /// </summary>
        /// <param name="supplier">the supplier to register</param>
        //////////////////////////////////////////////////////////////

        public static void RegisterSupplier(IConfigSupplier supplier)
        {
            AppConfig ac = GetConfig(supplier.AppName);

            ac.RegisterConfigSupplier(supplier);
        }