The unit test agent profiles are a focused set of agents that help you discover workflows and maps, write reusable specifications, generate typed mocks and test data, and implement MSTest suites for Azure Logic Apps Standard projects.
I did some experimentation this week with GitHub Copilot custom agents and custom prompts. The result was a couple of agents to help with creation of unit tests for Logic Apps Standard workflows and data maps.
These agent profiles are designed to keep test artifacts consistent and maintainable by separating discovery, specification, data generation, and implementation. Specifications serve as the single source of truth; generated code and data follow from the specs.
- Discover: Enumerate workflows/maps, triggers/actions, dependencies, and control flow to build a testability inventory.
- Spec (Speckit): Write reusable test specifications (intent, inputs/mocks, expected outcomes) stored in a predictable location.
- Cases: Design scenario catalogs with categories (Happy Path, Error Handling, Boundary Conditions, etc.).
- Test Data: Generate typed mocks (Logic Apps) or input/expected data files (Data Maps) per scenario.
- Implement: Produce MSTest code against the Automated Test SDK on net8.0, enforcing strict constraints for reliability.
- Project Batch: Run operations across all workflows/maps with pre-checks, scaffolding verification, and summary reporting.
ℹ️ You can find this project on GitHub: https://github.com/wsilveiranz/logicapps-unittest-custom-agent. This is an example of how those agents can be created using what is available in GitHub Copilot, so feel free to fork it and adjust it to your own requirements.
Agent Profiles Available
Logic Apps Workflow Unit Test Author
Specialist agent for authoring Logic Apps Standard workflow unit tests using MSTest (net8.0) and the Automated Test SDK. Produces spec-first test cases, typed mocks, and runnable MSTest implementations.
How It Works
- Discover workflows: Locate workflow.json, summarize triggers/actions, and identify external dependencies to mock.
- Spec-first: Write reusable specs capturing intent, mock plan, inputs, and expected outcomes.
- Create cases: Build scenario catalogs (Happy Path, Error Handling, Boundary Conditions, etc.).
- Generate test data: Produce typed MockOutput and ActionMock classes instances mapped to action names. This step is optional, as implementation will create test data if not available.
- Implement tests: Generate MSTest code enforcing SDK constraints and required annotations.
- Validate: Build and run tests; refine specs and data as needed.
- Batch (optional): Apply the flow across all workflows once scaffolding is verified.
| Skill | Description | Prompt File |
|---|---|---|
| Discover Workflows | Discover workflow definitions, summarize triggers/actions, and produce a mock inventory. | .github/prompts/la-unit-tests-discover.prompt.md |
| Create Test Cases | Create unit test cases from a workflow definition; define intent, inputs, mock plan, and expected outcomes. | .github/prompts/la-unit-tests-create-cases.prompt.md |
| Write Speckit Specs | Write and maintain Speckit-style specification documents for reusable scenarios. | .github/prompts/la-unit-tests-speckit-specs.prompt.md |
| Implement Tests | Implement MSTest unit tests using the Automated Test SDK with enforced constraints. | .github/prompts/la-unit-tests-implement.prompt.md |
| Generate Test Data | Generate trigger/action mock payloads and typed outputs for success and failure variants. | .github/prompts/la-unit-tests-generate-test-data.prompt.md |
| Project Batch | Execute project-wide operations with scaffolding verification and roll-up reporting. | .github/prompts/la-unit-tests-project-batch.prompt.md |
Logic Apps Data Map Unit Test Author
Specialist agent for authoring Data Map unit tests from LML or XSLT using MSTest (net8.0). Produces spec-first test cases, sample input/expected data, and MSTest implementations.
How It Works
- Discover data maps: Locate Artifacts/MapDefinitions/*.lml and Artifacts/Maps/*.xslt; summarize transformations and schema requirements.
- Spec-first: Write reusable specs capturing intent, input data, expected output, and validation criteria.
- Create cases: Build scenario catalogs (Happy Path, Empty/Missing, Boundary Values, Special Characters, Large Data, etc.).
- Generate test data: Produce representative input files and expected output files aligned to schemas and mapping rules. This step is optional, as implementation will create test data if not available.
- Implement tests: Generate MSTest classes using DataMapTestExecutor.
- Validate: Build and run tests; refine specs and data as needed.
- Batch (optional): Apply the flow across all maps; verify project scaffolding first.
| Skill | Description | Prompt File |
|---|---|---|
| Discover Data Maps | Discover LML/XSLT maps and schemas; summarize transformation structure and complexity. | .github/prompts/dm-unit-tests-discover.prompt.md |
| Create Test Cases | Design scenarios covering happy path, edge cases, and error handling. | .github/prompts/dm-unit-tests-create-cases.prompt.md |
| Write Speckit Specs | Write and maintain Speckit-style specs with mapping rules and validations. | .github/prompts/dm-unit-tests-speckit-specs.prompt.md |
| Implement Tests | Implement MSTest suites using DataMapTestExecutor with required defaults. | .github/prompts/dm-unit-tests-implement.prompt.md |
| Generate Test Data | Generate input and expected output files matched to map rules and schemas. | .github/prompts/dm-unit-tests-generate-test-data.prompt.md |
| Project Batch | Execute project-wide operations with scaffolding and summary reporting. | .github/prompts/dm-unit-tests-project-batch.prompt.md |
FAQ
Why Speckit-style specs?
Specs are human-readable contracts that drive consistent test implementation across teams and time. They decouple scenario design from code generation, improving reuse.
Can I run batch operations?
Yes. Use the project-batch profiles to orchestrate discovery and implementation across all workflows/maps once scaffolding is verified.
What if scaffolding is missing?
The Implement and Project Batch agents will stop and report the exact folders/files you need to create (via the Logic Apps Designer’s Create Unit Test command or manual steps).