@@ -2598,6 +2598,77 @@ await Assert.ThrowsAsync<InvalidOperationException>(async () =>
25982598
25992599 #endregion
26002600
2601+ #region AdditionalProperties Tests
2602+
2603+ [ Fact ]
2604+ public void AdditionalProperties_DefaultValue_ReturnsNull ( )
2605+ {
2606+ // Arrange
2607+ var chatClient = new Mock < IChatClient > ( ) . Object ;
2608+ var agent = new ChatClientAgent ( chatClient ) ;
2609+
2610+ // Act
2611+ var result = agent . AdditionalProperties ;
2612+
2613+ // Assert
2614+ Assert . Null ( result ) ;
2615+ }
2616+
2617+ [ Fact ]
2618+ public void AdditionalProperties_FromOptions_ReturnsOptionsValue ( )
2619+ {
2620+ // Arrange
2621+ var chatClient = new Mock < IChatClient > ( ) . Object ;
2622+ var additionalProperties = new AdditionalPropertiesDictionary
2623+ {
2624+ [ "beta" ] = true ,
2625+ [ "icon" ] = "agent-icon.png" ,
2626+ [ "requiresAuth" ] = true
2627+ } ;
2628+ var options = new ChatClientAgentOptions
2629+ {
2630+ AdditionalProperties = additionalProperties
2631+ } ;
2632+ var agent = new ChatClientAgent ( chatClient , options ) ;
2633+
2634+ // Act
2635+ var result = agent . AdditionalProperties ;
2636+
2637+ // Assert
2638+ Assert . NotNull ( result ) ;
2639+ Assert . Equal ( 3 , result . Count ) ;
2640+ Assert . Equal ( true , result [ "beta" ] ) ;
2641+ Assert . Equal ( "agent-icon.png" , result [ "icon" ] ) ;
2642+ Assert . Equal ( true , result [ "requiresAuth" ] ) ;
2643+ }
2644+
2645+ [ Fact ]
2646+ public void GetService_AIAgentMetadata_ReturnsMetadataWithAdditionalProperties ( )
2647+ {
2648+ // Arrange
2649+ var chatClient = new Mock < IChatClient > ( ) . Object ;
2650+ var additionalProperties = new AdditionalPropertiesDictionary
2651+ {
2652+ [ "beta" ] = true
2653+ } ;
2654+ var options = new ChatClientAgentOptions
2655+ {
2656+ AdditionalProperties = additionalProperties
2657+ } ;
2658+ var agent = new ChatClientAgent ( chatClient , options ) ;
2659+
2660+ // Act
2661+ var metadata = agent . GetService < AIAgentMetadata > ( ) ;
2662+
2663+ // Assert
2664+ Assert . NotNull ( metadata ) ;
2665+ Assert . NotNull ( metadata . AdditionalProperties ) ;
2666+ Assert . Single ( metadata . AdditionalProperties ) ;
2667+ Assert . Equal ( true , metadata . AdditionalProperties [ "beta" ] ) ;
2668+ }
2669+
2670+ #endregion
2671+
26012672 private static async IAsyncEnumerable < T > ToAsyncEnumerableAsync < T > ( IEnumerable < T > values )
26022673 {
26032674 await Task . Yield ( ) ;
0 commit comments