File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ public class AppSettings
1616 private string IgnoredProperty { get ; set ; }
1717}
1818
19+ public class SettingsExample0
20+ {
21+ public string RealKey { get ; set ; }
22+ }
23+
1924public class SettingsExample1
2025{
2126 public string SecretKey { get ; set ; }
Original file line number Diff line number Diff line change @@ -3,6 +3,16 @@ namespace DotEnv.Core.Tests.Binder;
33[ TestClass ]
44public class EnvBinderTests
55{
6+ [ TestMethod ]
7+ public void Bind_WhenPropertyNameDoesNotMatchRealKey_ShouldReturnSettingsInstance ( )
8+ {
9+ SetEnvironmentVariable ( "REAL_KEY" , "1234D" ) ;
10+
11+ var settings = new EnvBinder ( ) . Bind < SettingsExample0 > ( ) ;
12+
13+ Assert . AreEqual ( expected : "1234D" , actual : settings . RealKey ) ;
14+ }
15+
616 [ TestMethod ]
717 public void Bind_WhenPropertiesAreLinkedToTheDefaultProviderInstance_ShouldReturnSettingsInstance ( )
818 {
You can’t perform that action at this time.
0 commit comments