11using System ;
22using System . Collections . Generic ;
3+ using System . Reflection ;
4+ using Moq ;
35using Xunit ;
46
57namespace AWS . Lambda . Powertools . Common . Tests ;
@@ -42,10 +44,9 @@ public void Set_Multiple_Execution_Environment()
4244
4345 // Act
4446 systemWrapper . SetExecutionEnvironment ( this ) ;
45- systemWrapper . SetExecutionEnvironment ( this ) ;
4647
4748 // Assert
48- Assert . Equal ( $ "{ Constants . FeatureContextIdentifier } /Fake/1.0.0 { Constants . FeatureContextIdentifier } /Fake/1.0.0 ", systemWrapper . GetEnvironmentVariable ( "AWS_EXECUTION_ENV" ) ) ;
49+ Assert . Equal ( $ "{ Constants . FeatureContextIdentifier } /Fake/1.0.0", systemWrapper . GetEnvironmentVariable ( "AWS_EXECUTION_ENV" ) ) ;
4950 }
5051
5152 [ Fact ]
@@ -63,6 +64,20 @@ public void Set_Execution_Real_Environment()
6364
6465 [ Fact ]
6566 public void Set_Execution_Real_Environment_Multiple ( )
67+ {
68+ // Arrange
69+ var systemWrapper = new SystemWrapper ( new PowertoolsEnvironment ( ) ) ;
70+
71+ // Act
72+ systemWrapper . SetExecutionEnvironment ( this ) ;
73+ systemWrapper . SetExecutionEnvironment ( systemWrapper ) ;
74+
75+ // Assert
76+ Assert . Equal ( $ "{ Constants . FeatureContextIdentifier } /Tests/1.0.0 { Constants . FeatureContextIdentifier } /Common/0.0.1", systemWrapper . GetEnvironmentVariable ( "AWS_EXECUTION_ENV" ) ) ;
77+ }
78+
79+ [ Fact ]
80+ public void Set_Execution_Real_Environment_Multiple_Avoid_Duplicate ( )
6681 {
6782 // Arrange
6883 var systemWrapper = new SystemWrapper ( new PowertoolsEnvironment ( ) ) ;
@@ -72,7 +87,7 @@ public void Set_Execution_Real_Environment_Multiple()
7287 systemWrapper . SetExecutionEnvironment ( this ) ;
7388
7489 // Assert
75- Assert . Equal ( $ "{ Constants . FeatureContextIdentifier } /Tests/1.0.0 { Constants . FeatureContextIdentifier } /Tests/1.0.0 ", systemWrapper . GetEnvironmentVariable ( "AWS_EXECUTION_ENV" ) ) ;
90+ Assert . Equal ( $ "{ Constants . FeatureContextIdentifier } /Tests/1.0.0", systemWrapper . GetEnvironmentVariable ( "AWS_EXECUTION_ENV" ) ) ;
7691 }
7792
7893 public void Dispose ( )
0 commit comments