IAgentScenario
NexusLabs.Needlr.AgentFramework.Testing¶
IAgentScenario Interface¶
Defines a self-contained agent test scenario with seed → execute → verify lifecycle. Scenarios are discovered automatically when registered via DI.
Remarks¶
Each scenario declares its own system prompt, user prompt, and workspace seed data. The AgentScenarioRunner handles workspace creation, context scoping, diagnostics capture, and invokes Verify(IWorkspace, IAgentRunDiagnostics) after execution.
For multi-agent pipeline scenarios, consumers can implement custom runner logic that coordinates multiple agents using the scenario's prompts and workspace.
Properties¶
IAgentScenario.Description Property¶
Gets a human-readable description of what the scenario tests.
Property Value¶
IAgentScenario.Name Property¶
Gets the scenario name (used for selection and reporting).
Property Value¶
IAgentScenario.SystemPrompt Property¶
Gets the system prompt (agent instructions) for this scenario.
Property Value¶
IAgentScenario.UserPrompt Property¶
Gets the user message that starts the agent run.
Property Value¶
Methods¶
IAgentScenario.SeedWorkspace(IWorkspace) Method¶
Populates the workspace with files needed before the agent runs. Called by the runner before execution begins.
Parameters¶
workspace NexusLabs.Needlr.AgentFramework.Workspace.IWorkspace
The workspace to seed with test data.
IAgentScenario.Verify(IWorkspace, IAgentRunDiagnostics) Method¶
Verifies the scenario's expected outcomes after the agent run completes. Throw an exception (e.g., ScenarioVerificationException) to indicate failure.
void Verify(NexusLabs.Needlr.AgentFramework.Workspace.IWorkspace workspace, NexusLabs.Needlr.AgentFramework.Diagnostics.IAgentRunDiagnostics? diagnostics);
Parameters¶
workspace NexusLabs.Needlr.AgentFramework.Workspace.IWorkspace
The workspace after agent execution (contains any files the agent wrote).
diagnostics NexusLabs.Needlr.AgentFramework.Diagnostics.IAgentRunDiagnostics
Diagnostics from the run, or null if diagnostics were not captured.