File tree Expand file tree Collapse file tree 2 files changed +2
-24
lines changed
Cosmos.DataTransfer.CosmosExtension.UnitTests
Cosmos.DataTransfer.CosmosExtension Expand file tree Collapse file tree 2 files changed +2
-24
lines changed Original file line number Diff line number Diff line change @@ -481,27 +481,5 @@ public void GetPropertyValue_WithNullIntermediateValue_ReturnsNull()
481481 // Assert
482482 Assert . IsNull ( result ) ;
483483 }
484-
485- [ TestMethod ]
486- public void GetPropertyValue_WithLeadingSlash_WorksCorrectly ( )
487- {
488- // Arrange - Test that paths with leading slash work (defensive programming)
489- var expando = new ExpandoObject ( ) ;
490- var dict = ( IDictionary < string , object ? > ) expando ;
491- dict [ "id" ] = "test-id" ;
492-
493- var nestedExpando = new ExpandoObject ( ) ;
494- var nestedDict = ( IDictionary < string , object ? > ) nestedExpando ;
495- nestedDict [ "partitionkey" ] = "pk-value" ;
496-
497- dict [ "parent" ] = nestedExpando ;
498-
499- // Act - Path with leading slash (though TrimStart is called in actual code)
500- var result = InvokeGetPropertyValue ( expando , "/parent/partitionkey" ) ;
501-
502- // Assert
503- Assert . IsNotNull ( result ) ;
504- Assert . AreEqual ( "pk-value" , result ) ;
505- }
506484 }
507485}
Original file line number Diff line number Diff line change @@ -287,8 +287,8 @@ private static MemoryStream CreateItemStream(ExpandoObject item)
287287 private static string ? GetPropertyValue ( ExpandoObject item , string propertyName )
288288 {
289289 // Handle nested property paths (e.g., "property1/property2/property3")
290- // Split and remove empty entries to handle paths starting with '/' (e.g., "/property/nested")
291- var pathSegments = propertyName . Split ( '/' , StringSplitOptions . RemoveEmptyEntries ) ;
290+ // Note: Calling code uses TrimStart('/') to remove leading slash before calling this method
291+ var pathSegments = propertyName . Split ( '/' ) ;
292292 object ? current = item ;
293293
294294 foreach ( var segment in pathSegments )
You can’t perform that action at this time.
0 commit comments