/// <summary> /// Copies all of the values from the supplied <see cref="IConfigurationRoot"/> to function configuration /// environment variables. /// </summary> /// <param name="testContext">The context to add the configuration to.</param> /// <param name="configuration">The configuration to copy.</param> public static void CopyToFunctionConfigurationEnvironmentVariables(this SpecFlowContext testContext, IConfigurationRoot configuration) { FunctionConfiguration config = testContext.GetFunctionConfiguration(); foreach (KeyValuePair <string, string> item in configuration.AsEnumerable()) { config.EnvironmentVariables.Add(item.Key, item.Value); } }
/// <summary> /// Adds an environment variable to the configuration that will be used for any /// functions started via <see cref="FunctionsBindings"/>. /// </summary> /// <param name="testContext">The context to add the configuration to.</param> /// <param name="name">The name of the environment variable.</param> /// <param name="value">The value of the environment variable.</param> public static void AddFunctionConfigurationEnvironmentVariable(this SpecFlowContext testContext, string name, string value) { FunctionConfiguration config = testContext.GetFunctionConfiguration(); config.EnvironmentVariables.Add(name, value); }