Skip to content

Commit

Permalink
include a test showing that Interpolation works independent from SetE…
Browse files Browse the repository at this point in the history
…nvVars
  • Loading branch information
Philipp-Binder committed Sep 21, 2024
1 parent 1529d50 commit 385ecc9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/DotNetEnv.Tests/EnvConfigurationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ public void AddSourceToBuilderAndGetSection()
Assert.Equal("value2", section["Key2"]);
}

[Fact()]
public void AddSourceToBuilderAndParseInterpolatedTest()
[Theory]
[InlineData(true)]
[InlineData(false)]
public void AddSourceToBuilderAndParseInterpolatedTest(bool setEnvVars)
{
Environment.SetEnvironmentVariable("EXISTING_ENVIRONMENT_VARIABLE", "value");
Environment.SetEnvironmentVariable("DNE_VAR", null);
Expand All @@ -127,7 +129,7 @@ public void AddSourceToBuilderAndParseInterpolatedTest()
Environment.SetEnvironmentVariable("TEST4", null);

configuration = new ConfigurationBuilder()
.AddDotNetEnv("./.env_embedded")
.AddDotNetEnv("./.env_embedded", new LoadOptions(setEnvVars: setEnvVars))
.Build();

Assert.Equal("test", configuration["TEST"]);
Expand Down

0 comments on commit 385ecc9

Please sign in to comment.