/// <summary> /// Create a new StartContext with the given options. /// If the given options do not define any settings, then settings will be loaded from the config. /// </summary> /// <param name="options"></param> public StartContext(StartOptions options) { if (options == null) { throw new ArgumentNullException("options"); } SettingsLoader.LoadFromConfig(options.Settings); Options = options; EnvironmentData = new List <KeyValuePair <string, object> >(); }
public void LoadSettingsFromConfig_CaseInsensitive() { IDictionary <string, string> settings = SettingsLoader.LoadFromConfig(); 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)); }
public void LoadOptionsFromConfig_CaseInsensitive() { var options = new StartOptions(); SettingsLoader.LoadFromConfig(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)); }
/// <summary> /// Create a default ServiceProvider. /// </summary> /// <param name="configuration"></param> /// <returns></returns> public static IServiceProvider Create(Action <ServiceProvider> configuration) { return(Create(SettingsLoader.LoadFromConfig(), configuration)); }
/// <summary> /// Enumerate the default service types. /// </summary> /// <param name="callback"></param> public static void ForEach(Action <Type, Type> callback) { DoCallback(SettingsLoader.LoadFromConfig(), callback); }