Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 10, 2026

Motivation and Context

WorkflowFormulaState automatically calls Bind() in its constructor, syncing variables to the PowerFx engine. Explicit State.Bind() calls after State.Set() were redundant in most test cases.

Description

When Bind() is needed:
Only when variables set via State.Set() will be referenced in PowerFx expressions during test execution:

this.State.Set("NewId", FormulaValue.New(10));
this.State.Bind(); // Required: NewId used in expression below
ValueExpression.Expression("{id: Local.NewId}")

When Bind() is not needed:
After State.Set() calls where variables aren't used in subsequent expressions - the constructor already bound initial state.

Kept one necessary State.Bind() in AddWithExpressionAsync with explanatory comment.

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.

Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
Copilot AI changed the title [WIP] Add unit test class for EditTableExecutor Add unit tests for EditTableExecutor with 100% coverage Feb 10, 2026
Copilot AI requested a review from crickman February 10, 2026 23:39
@crickman crickman added .NET workflows Related to Workflows in agent-framework declarative-workflow v1.0 Features being tracked for the version 1.0 GA labels Feb 10, 2026
@github-actions github-actions bot changed the title Add unit tests for EditTableExecutor with 100% coverage .NET: Add unit tests for EditTableExecutor with 100% coverage Feb 10, 2026
Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
Copilot AI changed the title .NET: Add unit tests for EditTableExecutor with 100% coverage Remove redundant State.Bind() calls from EditTableExecutorTest Feb 10, 2026
@crickman crickman changed the title Remove redundant State.Bind() calls from EditTableExecutorTest .NET Workflows - Add unit tests for EditTableExecutorAction Feb 11, 2026
@crickman crickman changed the title .NET Workflows - Add unit tests for EditTableExecutorAction .NET Workflows - Add unit tests for EditTableExecutorAction (Declarative Workflows) Feb 11, 2026
@crickman crickman moved this to In Progress in Agent Framework Feb 11, 2026
@crickman crickman marked this pull request as ready for review February 11, 2026 16:37
Copilot AI review requested due to automatic review settings February 11, 2026 16:37
@crickman crickman enabled auto-merge February 11, 2026 16:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a dedicated unit test suite for the declarative workflow EditTableExecutor, validating expected state updates across supported TableChangeType operations and a few key failure/edge scenarios.

Changes:

  • Introduces EditTableExecutorTest coverage for Add/Remove/Clear/TakeFirst/TakeLast behaviors, including empty-table cases.
  • Adds negative tests for invalid model construction and non-table variables, plus a remove-with-non-table-value scenario.

…ts/ObjectModel/EditTableExecutorTest.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

declarative-workflow .NET v1.0 Features being tracked for the version 1.0 GA workflows Related to Workflows in agent-framework

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants