Beispiel #1
0
        public void LoadOptionsFromFile_CaseInsensitive()
        {
            var options = new StartOptions();

            SettingsLoader.LoadFromSettingsFile("Settings.txt", options.Settings);
            IDictionary <string, string> settings = options.Settings;
            string value;

            Assert.True(settings.TryGetValue("UpperCase", out value));
            Assert.True(string.Equals("UpperCaseValue", value, StringComparison.Ordinal));

            Assert.True(settings.TryGetValue("uppercase", out value));
            Assert.True(string.Equals("UpperCaseValue", value, StringComparison.Ordinal));
        }
Beispiel #2
0
 /// <summary>
 /// Create a default ServiceProvider with the given settings file.
 /// </summary>
 /// <param name="settingsFile"></param>
 /// <param name="configuration"></param>
 /// <returns></returns>
 public static IServiceProvider Create(string settingsFile, Action <ServiceProvider> configuration)
 {
     return(Create(SettingsLoader.LoadFromSettingsFile(settingsFile), configuration));
 }
Beispiel #3
0
 /// <summary>
 /// Enumerate the default service types with the given settings file overrides.
 /// </summary>
 /// <param name="settingsFile"></param>
 /// <param name="callback"></param>
 public static void ForEach(string settingsFile, Action <Type, Type> callback)
 {
     DoCallback(SettingsLoader.LoadFromSettingsFile(settingsFile), callback);
 }
Beispiel #4
0
 private static void LoadSettings(StartOptions options, string settingsFile)
 {
     SettingsLoader.LoadFromSettingsFile(settingsFile, options.Settings);
 }