fix: include because-reason when verifying that an exception is thrown#657
Merged
fix: include because-reason when verifying that an exception is thrown#657
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that exception verification tests include a clear "because" reason, refines the logic for setting the reason in expectation nodes, and adjusts the build pipeline configuration to target core-only builds.
- Updates exception verification tests to include an explanatory reason.
- Refactors the SetReason logic in OrNode and AndNode to handle empty expectation nodes.
- Changes the BuildScope in the build pipeline from Default to CoreOnly.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Tests/aweXpect.Tests/Delegates/ThatDelegate.ThrowsException.Tests.cs | Enhances exception verification tests with a "because" reason to improve clarity. |
| Source/aweXpect.Core/Core/Nodes/OrNode.cs | Adapts SetReason to delegate to a child node if the current expectation node is empty. |
| Source/aweXpect.Core/Core/Nodes/AndNode.cs | Adapts SetReason to delegate to a child node if the current expectation node is empty. |
| Pipeline/Build.cs | Updates BuildScope configuration to build only core components. |
Comments suppressed due to low confidence (1)
Pipeline/Build.cs:22
- Update the accompanying documentation or comments to clarify the reasoning behind changing the BuildScope from Default to CoreOnly.
readonly BuildScope BuildScope = BuildScope.CoreOnly;
|
Contributor
|
This is addressed in release v2.18.0. |
This was referenced Sep 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

When an "And" node (or an "Or" node) has an empty node, this node is ignored during evaluation, but the because reason is applied to it.
In this case, the because reason should instead be applied to the latest previous node.
Becausenot included when checking for a delegate to throw #654