@@ -160,28 +160,33 @@ public async Task ResolveStringValueAsync_WhenFlagDoesNotExist_ReturnsDefaultVal
160160 public async Task ResolveStructureValueAsync_WhenFlagExists_ReturnsCorrectValue ( )
161161 {
162162 // Arrange
163- const string flagKey = "configProfileId:test-enabled-flag" ;
164- const string jsonValue = "{\" key\" : \" value\" , \" number\" : 42}" ;
165- SetupMockResponse ( $ "{{\" { flagKey } \" : { jsonValue } }}") ;
163+ const string flagKey = "configProfileId:test-enabled-flag" ;
164+ SetupMockResponse ( _jsonContent ) ;
166165
167166 // Act
168167 var result = await _provider . ResolveStructureValueAsync ( flagKey , new Value ( ) ) ;
169168
170169 // Assert
171170 Assert . NotNull ( result . Value . AsStructure ) ;
172- Assert . Equal ( "value" , result . Value . AsStructure [ "key" ] . AsString ) ;
173- Assert . Equal ( 42 , result . Value . AsStructure [ "number" ] . AsInteger ) ;
171+ Assert . True ( result . Value . AsStructure [ "enabled" ] . AsBoolean ) ;
172+ Assert . Equal ( "testValue" , result . Value . AsStructure [ "stringAttribute" ] . AsString ) ;
173+ Assert . Equal ( 42 , result . Value . AsStructure [ "intAttribute" ] . AsInteger ) ;
174174 }
175175
176176 [ Fact ]
177177 public async Task ResolveStructureValueAsync_WhenFlagDoesNotExist_ReturnsDefaultValue ( )
178178 {
179179 // Arrange
180180 const string flagKey = "configProfileId:test-enabled-flag" ;
181- var defaultValue = new Value ( new Dictionary < string , Value >
182- {
183- [ "default" ] = new Value ( "default" )
184- } ) ;
181+ var defaultValue = new Value (
182+ new Structure (
183+ new Dictionary < string , Value >
184+ {
185+ [ "default" ] = new Value ( "default" )
186+ }
187+ )
188+ ) ;
189+
185190 SetupMockResponse ( "{}" ) ;
186191
187192 // Act
@@ -198,15 +203,14 @@ public async Task ResolveStructureValueAsync_WhenFlagDoesNotExist_ReturnsDefault
198203 public async Task ResolveValue_WithAttributeKey_ReturnsAttributeValue ( )
199204 {
200205 // Arrange
201- const string flagKey = "myFlag:color" ;
202- const string expectedValue = "blue" ;
203- SetupMockResponse ( $ "{{\" myFlag\" : {{\" color\" : \" { expectedValue } \" }}}}") ;
206+ const string flagKey = "configProfileId:test-enabled-flag:stringAttribute" ;
207+ SetupMockResponse ( _jsonContent ) ;
204208
205209 // Act
206210 var result = await _provider . ResolveStringValueAsync ( flagKey , "default" ) ;
207211
208212 // Assert
209- Assert . Equal ( expectedValue , result . Value ) ;
213+ Assert . Equal ( "testValue" , result . Value ) ;
210214 }
211215
212216 [ Fact ]
0 commit comments