示例#1
0
        public void ConfigFileReaderTestFromEnvVar()
        {
            Environment.SetEnvironmentVariable("CONFIGLITE_" + ConfigFileReader.CONFIG_FILE_ENV_VAR, "config.ini");

            ConfigFileReader reader = ConfigFileReader.CreateFromFile("CONFIGLITE", "config.error.ini");

            Assert.Equal(13, reader.Configurations.Count);

            reader = ConfigFileReader.CreateFromEnvVar("CONFIGLITE");

            Assert.Equal(13, reader.Configurations.Count);

            Environment.SetEnvironmentVariable("CONFIGLITE_" + ConfigFileReader.CONFIG_FILE_ENV_VAR, null);
        }
示例#2
0
 private ConfigStore(string envVarPrefix)
 {
     Item.EnvVarEnvVarPrefix = envVarPrefix;
     Item.ConfigFileReader   = ConfigFileReader.CreateFromEnvVar(envVarPrefix);
 }