@@ -25,7 +25,7 @@ public FlowContextTests()
2525 var testModel = new GenericLocalModel ( _testModelId ) ;
2626 ModelRegistry . RegisterOrReplace ( testModel ) ;
2727 }
28-
28+
2929 [ Fact ]
3030 public async Task WithId_ShouldSetFlowId ( )
3131 {
@@ -34,7 +34,7 @@ public async Task WithId_ShouldSetFlowId()
3434
3535 // Act
3636 var result = _flowContext . WithId ( expectedId ) ;
37-
37+
3838 // Setup mock to return flow with the set ID
3939 _mockFlowService
4040 . Setup ( s => s . GetFlowById ( expectedId ) )
@@ -55,13 +55,14 @@ public async Task WithName_ShouldSetFlowName()
5555
5656 // Act
5757 var result = _flowContext . WithName ( expectedName ) ;
58-
58+
5959 // Setup mock to return flow with the set name
6060 _mockFlowService
6161 . Setup ( s => s . GetFlowById ( It . IsAny < string > ( ) ) )
62- . ReturnsAsync ( new AgentFlow {
63- Id = It . IsAny < string > ( ) ,
64- Name = expectedName
62+ . ReturnsAsync ( new AgentFlow
63+ {
64+ Id = It . IsAny < string > ( ) ,
65+ Name = expectedName
6566 } ) ;
6667
6768 var flow = await _flowContext . GetCurrentFlow ( ) ;
@@ -92,24 +93,32 @@ public async Task CreateAsync_ShouldCallFlowService()
9293 public async Task ProcessAsync_WithStringMessage_ShouldReturnChatResult ( )
9394 {
9495 // Arrange
95- var firstAgent = new Agent { Id = "first-agent" , Order = 0 , CurrentBehaviour = It . IsAny < string > ( ) , Context = new AgentData ( ) } ;
96+ var firstAgent = new Agent
97+ {
98+ Id = "first-agent" ,
99+ Order = 0 ,
100+ CurrentBehaviour = It . IsAny < string > ( ) ,
101+ Config = new AgentConfig ( )
102+ } ;
96103 _flowContext . AddAgent ( firstAgent ) ;
97104
98105 var message = "Hello, flow!" ;
99- var chat = new Chat { Id = firstAgent . Id , Messages = new List < Message > ( ) , ModelId = _testModelId , Name = "test" } ;
106+ var chat = new Chat { Id = firstAgent . Id , Messages = [ ] , ModelId = _testModelId , Name = "test" } ;
100107
101108 _mockAgentService
102109 . Setup ( s => s . GetChatByAgent ( firstAgent . Id ) )
103110 . ReturnsAsync ( chat ) ;
104111
105112 _mockAgentService
106113 . Setup ( s => s . Process ( It . IsAny < Chat > ( ) , firstAgent . Id , It . IsAny < Knowledge > ( ) , It . IsAny < bool > ( ) , null , null ) )
107- . ReturnsAsync ( new Chat {
108- ModelId = _testModelId ,
114+ . ReturnsAsync ( new Chat
115+ {
116+ ModelId = _testModelId ,
109117 Name = "test" ,
110- Messages = new List < Message > {
111- new ( ) { Content = "Response" , Role = "Assistant" , Type = MessageType . LocalLLM }
112- }
118+ Messages =
119+ [
120+ new ( ) { Content = "Response" , Role = "Assistant" , Type = MessageType . LocalLLM }
121+ ]
113122 } ) ;
114123
115124 // Act
@@ -165,17 +174,17 @@ public async Task FromExisting_ShouldCreateFlowContextFromExistingFlow()
165174 {
166175 // Arrange
167176 var existingFlowId = "existing-flow-id" ;
168- var existingFlow = new AgentFlow
169- {
170- Id = existingFlowId ,
177+ var existingFlow = new AgentFlow
178+ {
179+ Id = existingFlowId ,
171180 Name = "Existing Flow" ,
172181 Agents =
173182 [
174183 new Agent
175184 {
176185 Id = "agent1" ,
177186 CurrentBehaviour = It . IsAny < string > ( ) ,
178- Context = new AgentData ( )
187+ Config = new AgentConfig ( )
179188 }
180189 ]
181190 } ;
@@ -203,4 +212,4 @@ public async Task FromExisting_ShouldThrowArgumentExceptionWhenFlowNotFound()
203212 // Act & Assert
204213 await Assert . ThrowsAsync < FlowNotFoundException > ( ( ) => _flowContext . FromExisting ( nonExistentFlowId ) ) ;
205214 }
206- }
215+ }
0 commit comments