Language

AgentTestHost.CreateTestFlow Method

Definition

Creates a TestFlow wired to the IAgent resolved from DI. Because IAgent is registered as transient, each call produces a new agent instance. All flows share the same Adapter and its ActiveQueue.

public Microsoft.Agents.Builder.Testing.TestFlow CreateTestFlow();
member this.CreateTestFlow : unit -> Microsoft.Agents.Builder.Testing.TestFlow
Public Function CreateTestFlow () As TestFlow

Returns

Remarks

The agent is resolved from the root DI scope. Register IAgent and its dependencies as transient or singleton — scoped registrations will behave as singletons for the lifetime of the host.

Applies to