/// <summary> /// Creates a copy of this command, setting the environment variables to the value configured by the specified delegate. /// </summary> public Command WithEnvironmentVariables(Action <EnvironmentVariablesBuilder> configure) { var builder = new EnvironmentVariablesBuilder(); configure(builder); return(WithEnvironmentVariables(builder.Build())); }
public void I_can_build_environment_variables_from_multiple_individual_variables() { // Arrange var builder = new EnvironmentVariablesBuilder(); // Act var envVars = builder .Set("foo", "bar") .Set("lo", "dash") .Build(); // Assert envVars.Should().BeEquivalentTo(new Dictionary <string, string> { ["foo"] = "bar", ["lo"] = "dash" }); }
public void Environment_variables_can_be_set_with_a_builder() { // Arrange var builder = new EnvironmentVariablesBuilder(); // Act var envVars = builder .Set("foo", "bar") .Set("lo", "dash") .Build(); // Assert envVars.Should().BeEquivalentTo(new Dictionary <string, string> { ["foo"] = "bar", ["lo"] = "dash" }); }