Skip to content

Commit

Permalink
Test case added for issue #6
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDave1999 committed Dec 26, 2021
1 parent 63879d6 commit 6b50f85
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/Parser/EnvParserOptionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,21 @@ public void Parse_WhenAllowedOverwriteExistingVars_ShouldOverwriteTheValue()
Assert.AreEqual("VAL1", GetEnvironmentVariable("ALLOW_OVERWRITE_1"));
Assert.AreEqual("VAL2", GetEnvironmentVariable("ALLOW_OVERWRITE_2"));
}

[TestMethod]
public void Parse_WhenSetsCommentChar_ShouldIgnoreComment()
{
string env = @"
;KEY1 = VAL1
;KEY2 = VAL2
";

new EnvParser()
.SetCommentChar(';')
.Parse(env);

Assert.IsNull(GetEnvironmentVariable(";KEY1"));
Assert.IsNull(GetEnvironmentVariable(";KEY2"));
}
}
}

0 comments on commit 6b50f85

Please sign in to comment.