al-agent-test
Skill115 starsChanged 14 days agoMITView on GitHub
Generate comprehensive test codeunits for Business Central Agent SDK integrations. Covers 6 categories: Registration, Factory, Metadata, TaskExecution, TaskIntegration, AgentSession.
In this repository64 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- claude-plugin/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- instructions/copilot-instructions.mdCopilot instructions
- agent-builderSkill
- al-agent-createSkill
- al-agent-instructionsSkill
- al-agent-taskSkill
- al-agent-testSkill
- al-buildSkill
- al-context-createSkill
- al-initializeSkill
- al-memory-createSkill
- al-pr-prepareSkill
- al-spec-createSkill
- architectSkill
- auditSkill
- conductSkill
- developSkill
- presalesSkill
- reviewSkill
- skill-agent-instructionsSkill
- skill-agent-task-patternsSkill
- skill-agent-toolkitSkill
- skill-al-review-pipelineSkill
- skill-apiSkill
- skill-contribution-assistantSkill
- skill-copilotSkill
- skill-debugSkill
- skill-estimationSkill
- skill-eventsSkill
- skill-migrateSkill
- skill-pagesSkill
- skill-performanceSkill
- skill-permissionsSkill
- skill-testingSkill
- skill-translateSkill
- specSkill
- triageSkill
- al-agent-createSkill
- al-agent-instructionsSkill
- al-agent-taskSkill
- al-buildSkill
- al-context-createSkill
- al-initializeSkill
- al-memory-createSkill
- al-pr-prepareSkill
- al-spec-createSkill
- skill-agent-instructionsSkill
- skill-agent-task-patternsSkill
- skill-agent-toolkitSkill
- skill-al-review-pipelineSkill
- skill-apiSkill
- skill-contribution-assistantSkill
- skill-copilotSkill
- skill-debugSkill
- skill-estimationSkill
- skill-eventsSkill
- skill-migrateSkill
- skill-pagesSkill
- The first 60 shown.
The file
Files
Workflow: Test Agent SDK Integration
Generates tests for all Agent SDK layers. Interface signatures come from skill-agent-toolkit; task pattern verification rules come from skill-agent-task-patterns.
Load skills: skill-agent-toolkit (interface signatures), skill-agent-task-patterns (Pattern C/D/H rules for integration tests).
6 required test categories
1. Registration tests
[Test]
procedure CopilotCapabilityIsRegistered()
var
CopilotCapability: Codeunit "Copilot Capability";
begin
Assert.IsTrue(
CopilotCapability.IsCapabilityRegistered(
Enum::"Copilot Capability"::"{Agent} Capability"),
'Copilot capability must be registered on install');
end;
[Test]
procedure AgentMetadataProviderEnumExists()
var
Provider: Enum "Agent Metadata Provider";
begin
Provider := Enum::"Agent Metadata Provider"::"{Agent}";
Assert.AreEqual('{Agent}', Format(Provider), 'Enum must exist');
end;2. Factory tests (IAgentFactory)
[Test]
procedure FactoryReturnsSetupPageId()
var
Factory: Codeunit {Agent}Factory;
begin
Assert.AreNotEqual(0, Factory.GetFirstTimeSetupPageId(), 'Must return setup page ID');
end;
[Test]
procedure FactoryReturnsDefaultInitials()
var
Factory: Codeunit {Agent}Factory;
begin
Assert.AreNotEqual('', Factory.GetDefaultInitials(), 'Must return initials');
end;
[Test]
procedure FactoryReturnsCopilotCapability()
var
Factory: Codeunit {Agent}Factory;
begin
Assert.AreEqual(
Enum::"Copilot Capability"::"{Agent} Capability",
Factory.GetCopilotCapability(),
'Must return correct capability');
end;
[Test]
procedure FactoryReturnsDefaultProfile()
var
Factory: Codeunit {Agent}Factory;
TempProfile: Record "All Profile" temporary;
begin
Factory.GetDefaultProfile(TempProfile);
Assert.RecordIsNotEmpty(TempProfile);
end;
[Test]
procedure FactoryReturnsDefaultPermissions()
var
Factory: Codeunit {Agent}Factory;
TempAccess: Record "Access Control Buffer" temporary;
begin
Factory.GetDefaultAccessControls(TempAccess);
Assert.RecordIsNotEmpty(TempAccess);
end;3. Metadata tests (IAgentMetadata)
[Test]
procedure MetadataReturnsSetupPageId()
var
Metadata: Codeunit {Agent}Metadata;
NullGuid: Guid;
begin
Assert.AreNotEqual(0, Metadata.GetSetupPageId(NullGuid), 'Must return setup page');
end;
[Test]
procedure MetadataReturnsSummaryPageId()
var
Metadata: Codeunit {Agent}Metadata;
NullGuid: Guid;
begin
Assert.AreNotEqual(0, Metadata.GetSummaryPageId(NullGuid), 'Must return summary page');
end;
[Test]
procedure MetadataReturnsMessagePageId()
var
Metadata: Codeunit {Agent}Metadata;
NullGuid: Guid;
begin
Assert.AreNotEqual(0, Metadata.GetAgentTaskMessagePageId(NullGuid, NullGuid), 'Must return message page');
end;4. Task Execution tests (IAgentTaskExecution)
[Test]
procedure UserInterventionSuggestionsProvided()
var
TaskExec: Codeunit {Agent}TaskExecution;
RequestDetails: Record "Agent User Int Request Details";
Suggestions: Record "Agent Task User Int Suggestion";
begin
RequestDetails.Type := RequestDetails.Type::Assistance;
TaskExec.GetAgentTaskUserInterventionSuggestions(RequestDetails, Suggestions);
Assert.RecordIsNotEmpty(Suggestions);
end;5. Task Integration tests
Apply Pattern C rules from skill-agent-task-patterns:
- Task created with correct ExternalId format
- Task NOT created when business condition is false
- Message contains all required context fields
[TryFunction]does not block business events on failure- Telemetry logged via
Session.LogMessageon failure
6. Agent Session tests
[Test]
procedure AgentSessionNotDetectedInNormalContext()
var
AgentSession: Codeunit "Agent Session";
Provider: Enum "Agent Metadata Provider";
begin
Assert.IsFalse(AgentSession.IsAgentSession(Provider), 'Should not be in agent session');
end;Coverage matrix
| Category | Test | Status |
| Registration | CopilotCapability | |
| Registration | EnumExists | |
| Factory | SetupPageId | |
| Factory | DefaultInitials | |
| Factory | CopilotCapability | |
| Factory | DefaultProfile | |
| Factory | DefaultPermissions | |
| Factory | CreationRules | |
| Metadata | SetupPageId | |
| Metadata | SummaryPageId | |
| Metadata | MessagePageId | |
| Metadata | Annotations | |
| TaskExecution | InputValidation | |
| TaskExecution | OutputPostProcess | |
| TaskExecution | Suggestions | |
| TaskExecution | PageContext | |
| TaskIntegration | Creation | |
| TaskIntegration | ConditionFilter | |
| TaskIntegration | MessageContent | |
| TaskIntegration | ErrorHandling | |
| AgentSession | Detection |
Skills Evidencing
End with:
**Skills loaded**: skill-agent-toolkit, skill-agent-task-patterns
**Patterns applied**:
- Interface signatures verified against skill-agent-toolkit
- Pattern C TryFunction + telemetry rules verified in integration testsDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

