Skip to content

.NET Workflows - Add unit tests for QuestionExecutor#3892

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-unit-test-class-for-questionexecutor
Draft

.NET Workflows - Add unit tests for QuestionExecutor#3892
Copilot wants to merge 3 commits intomainfrom
copilot/add-unit-test-class-for-questionexecutor

Conversation

Copy link
Contributor

Copilot AI commented Feb 12, 2026

Motivation and Context

QuestionExecutor lacked unit test coverage. This PR adds comprehensive tests following existing patterns from ForeachExecutorTest to validate all code paths and handlers.

Description

Created QuestionExecutorTest with 15 tests covering:

Handler Methods

  • ExecuteAsync - AlwaysPrompt, SkipQuestionMode variants, variable state conditions
  • PrepareResponseAsync - prompt preparation and count increment
  • CaptureResponseAsync - valid/invalid/unrecognized entity extraction, autoSend behavior, repeat count exceeded
  • CompleteAsync - completion event emission

Static Methods & Utilities

  • IsComplete - result state validation
  • Steps naming convention (Prepare, Input, Capture)

Test Design

  • Reusable CreateModel helper for Question model instantiation
  • Distinct private methods per handler (ExecuteTestAsync, PrepareResponseTestAsync, CaptureResponseTestAsync, CompleteTestAsync)
  • Mock WorkflowAgentProvider with Moq for isolated testing
  • No var keyword, no underscores in test names, minimal namespace references

Coverage: 86.66% line coverage, all 15 tests passing

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 12, 2026 18:59
Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
…e logic

Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
Copilot AI changed the title [WIP] Add unit test class for QuestionExecutor Add comprehensive unit tests for QuestionExecutor Feb 12, 2026
Copilot AI requested a review from crickman February 12, 2026 19:10
@crickman crickman changed the title Add comprehensive unit tests for QuestionExecutor .NET Workflows - Add unit tests for QuestionExecutor Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants