fix:Property set expression builder does not accept null values and lambdas - #239
Merged
Merged
Conversation
ivo-stoilov
force-pushed
the
stoilov/fix-property-expression-arrangement
branch
from
May 29, 2025 10:20
aa51de4 to
09df369
Compare
MariaDch
approved these changes
May 29, 2025
ivo-stoilov
force-pushed
the
stoilov/fix-property-expression-arrangement
branch
3 times, most recently
from
May 29, 2025 12:31
418df50 to
b85506a
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the property expression builder to accept null constants and lambda expressions for setting values, and updates related docs and error messaging.
- Specify the target type in
Expression.Constantto allownullvalues. - Introduce a
Set(Expression<Func<T>>)overload for setting via lambda. - Refine error messages in
ArrangeSetand improve XML documentation in interfaces andExprutility.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| PropertyExpressionBuilder.cs | Added typeof(T) to constant expression and new Set(Expression<Func<T>>) overload. |
| Mock.Arrange.cs | Clarified ArrangeSet(Action) error text and updated usage examples. |
| IPropertyExpressionBuilder.cs | Added overload and expanded XML docs for both Set methods and Get. |
| Expr.cs | Switched to ArgumentException for invalid expressions and enriched XML documentation. |
Comments suppressed due to low confidence (2)
Telerik.JustMock/PropertyExpressionBuilder.cs:46
- Add unit tests for the new
Set(Expression<Func<T>>)overload, including cases with null inputs and various lambda bodies, to validate its behavior.
public Expression<Action> Set(Expression<Func<T>> expression)
Telerik.JustMock/Mock.Arrange.cs:161
- Update or add tests to assert the updated ArrangeSet error message and example formatting when OnDemand is enabled, preventing future regressions in output.
sb.AppendLine("ArrangeSet(Action) is not compatible with the OnDemand feature.");
ivo-stoilov
force-pushed
the
stoilov/fix-property-expression-arrangement
branch
from
May 29, 2025 12:49
b85506a to
b6d63d2
Compare
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.
closes telerik/MATTeam#905