-
Notifications
You must be signed in to change notification settings - Fork 1.1k
.NET Workflows - Add unit tests for CopyConversationMessagesExecutor (Declarative Workflows) #3834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.NET Workflows - Add unit tests for CopyConversationMessagesExecutor (Declarative Workflows) #3834
Conversation
Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive unit test coverage for CopyConversationMessagesExecutor, a component that copies messages into agent conversations within the declarative workflows system. The tests validate message copying behavior across different input formats (string, single record, multiple messages in table), expression types (literal vs. PowerFx variable), conversation contexts (workflow vs. external), and edge cases (blank/null messages).
Changes:
- Added
CopyConversationMessagesExecutorTest.cswith 7 test methods covering all execution paths - Refactored
GetInputMessages()inCopyConversationMessagesExecutor.csto add explicit null validation usingThrow.IfNull, removing conditional null handling
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
CopyConversationMessagesExecutorTest.cs |
New test class with 7 test methods following established patterns, using MockAgentProvider for message capture and verification |
CopyConversationMessagesExecutor.cs |
Refactored GetInputMessages() to add explicit Throw.IfNull validation for required Messages property, simplifying control flow |
Motivation and Context
Adds test coverage for
CopyConversationMessagesExecutorto validate message copying behavior across different input formats and conversation contexts.Description
Test Coverage (7 test methods)
Implementation
CopyConversationMessagesExecutorTest.csinObjectModelfolderExecuteTestAsyncandCreateModelhelper methodsMockAgentProviderfor message capture and verificationAchieves 100% code coverage of all execution paths including:
ExecuteAsync: message iteration, conversation type detection, event generationGetInputMessages: expression evaluation and message conversionContribution Checklist