Skip to content

Commit 385ecc9

Browse files
include a test showing that Interpolation works independent from SetEnvVars
1 parent 1529d50 commit 385ecc9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/DotNetEnv.Tests/EnvConfigurationTests.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ public void AddSourceToBuilderAndGetSection()
117117
Assert.Equal("value2", section["Key2"]);
118118
}
119119

120-
[Fact()]
121-
public void AddSourceToBuilderAndParseInterpolatedTest()
120+
[Theory]
121+
[InlineData(true)]
122+
[InlineData(false)]
123+
public void AddSourceToBuilderAndParseInterpolatedTest(bool setEnvVars)
122124
{
123125
Environment.SetEnvironmentVariable("EXISTING_ENVIRONMENT_VARIABLE", "value");
124126
Environment.SetEnvironmentVariable("DNE_VAR", null);
@@ -127,7 +129,7 @@ public void AddSourceToBuilderAndParseInterpolatedTest()
127129
Environment.SetEnvironmentVariable("TEST4", null);
128130

129131
configuration = new ConfigurationBuilder()
130-
.AddDotNetEnv("./.env_embedded")
132+
.AddDotNetEnv("./.env_embedded", new LoadOptions(setEnvVars: setEnvVars))
131133
.Build();
132134

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

0 commit comments

Comments
 (0)