-
-
Notifications
You must be signed in to change notification settings - Fork 84
Add support to ExecuteDelete and ExecuteUpdate #81
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
Add support to ExecuteDelete and ExecuteUpdate #81
Conversation
|
Hello @lazaro-ansaldi thanks for your effort. I will merge the PR to a temporary branch, but I will need some time to move these changes into the master and create a new release. Thanks for understanding. |
|
Hi @romantitov , Thank you for the prompt response! I fully understand the workflow of this feature. If any test code adjustments are needed, I’d be happy to help. Additionally, please feel free to reach out if you'd like me to perform any validations against a beta version. Thanks again! Best regards, |
|
Hi. Thank you @romantitov for MockQueryable. Thank you @lazaro-ansaldi for this PR. When running the new unit test Is my assumption correct? Thank you. |
|
Hi @icnocop, Thank you for testing the change and providing your valuable feedback! To simplify the scope of this update, the mock for ExecuteUpdate and ExecuteDelete will now only return the number of affected rows based on the query, without actually performing the data modifications. While this isn’t the ideal behavior for a mock, it helps avoid a breaking change, which is our current priority. If you'd like, feel free to extend this functionality to support actual updates and deletions within the mocked collection. I’d be happy to assist if you need any help along the way. Thanks again! |
|
I'd be interested in the updated ExecuteUpdate and ExecuteDelete too. |
|
Hi @romantitov, Thanks! |
|
Hello, @romantitov, @lazaro-ansaldi, any updates on when this will be released? My team and I are also waiting on this feature :) |
|
Works perfectly. Looking forward to seeing a non-beta version with these awesome changes! Thank you @lazaro-ansaldi ! |
Updated [MockQueryable.NSubstitute](https://github.com/romantitov/MockQueryable) from 7.0.3 to 8.0.0. <details> <summary>Release notes</summary> _Sourced from [MockQueryable.NSubstitute's releases](https://github.com/romantitov/MockQueryable/releases)._ ## 8.0.0 ## What's Changed #81 Add support to ExecuteDelete and ExecuteUpdate - Thanks @lazaro-ansaldi and @Catlandor #82 Update versions of Moq, NSubstitute and FakeItEasy to newer versions without known vulnerabilities - Thanks @Catlandor #73 Supporting EF.Functions.Like and/or prossibility to provide cusotm ExpressionVisitor - Thanks @Catlandor #66 Not suported with EF7: ExecuteDeleteAsync and ExecuteUpdateAsync - Thanks @Catlandor ## New Contributors * @lazaro-ansaldi made their first contribution in romantitov/MockQueryable#81 * @Catlandor made their first contribution in romantitov/MockQueryable#84 **Full Changelog**: romantitov/MockQueryable@v7.0.3...v8.0.0 ## 7.0.4-beta ## What's Changed * Altered namespace for extension method to revert a breaking change wi… by @StevePy in romantitov/MockQueryable#80 ## New Contributors * @StevePy made their first contribution in romantitov/MockQueryable#80 **Full Changelog**: romantitov/MockQueryable@v7.0.2...7.0.4-beta Commits viewable in [compare view](romantitov/MockQueryable@v7.0.3...v8.0.0). </details> Updated [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.13.1 to 4.14.0. <details> <summary>Release notes</summary> _Sourced from [Roslynator.Analyzers's releases](https://github.com/dotnet/roslynator/releases)._ ## 4.14.0 ### Added - [CLI] Add support for GitLab analyzer reports ([PR](dotnet/roslynator#1633)) ### Fixed - Fix analyzer [RCS1264](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1264) ([PR](dotnet/roslynator#1666)) - Fix analyzer [RCS1229](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1229) ([PR](dotnet/roslynator#1667)) - Fix analyzer [RCS1250](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1250) ([PR](dotnet/roslynator#1652) by @aihnatiuk) - Fix analyzer [RCS1260](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1260) ([PR](dotnet/roslynator#1668)) - Fix analyzer [RCS1105](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1105) ([PR](dotnet/roslynator#1669)) - Fix analyzer [RCS1260](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1260) ([PR](dotnet/roslynator#1672)) ### Changed - Disable analyzer [RCS1036](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1036) by default ([PR](dotnet/roslynator#1671)) - Use analyzer [RCS0063](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0063) instead ### Removed - Remove legacy config options ([PR](dotnet/roslynator#1304)) Commits viewable in [compare view](dotnet/roslynator@v4.13.1...v4.14.0). </details> Updated [Roslynator.CodeAnalysis.Analyzers](https://github.com/dotnet/roslynator) from 4.13.1 to 4.14.0. <details> <summary>Release notes</summary> _Sourced from [Roslynator.CodeAnalysis.Analyzers's releases](https://github.com/dotnet/roslynator/releases)._ ## 4.14.0 ### Added - [CLI] Add support for GitLab analyzer reports ([PR](dotnet/roslynator#1633)) ### Fixed - Fix analyzer [RCS1264](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1264) ([PR](dotnet/roslynator#1666)) - Fix analyzer [RCS1229](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1229) ([PR](dotnet/roslynator#1667)) - Fix analyzer [RCS1250](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1250) ([PR](dotnet/roslynator#1652) by @aihnatiuk) - Fix analyzer [RCS1260](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1260) ([PR](dotnet/roslynator#1668)) - Fix analyzer [RCS1105](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1105) ([PR](dotnet/roslynator#1669)) - Fix analyzer [RCS1260](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1260) ([PR](dotnet/roslynator#1672)) ### Changed - Disable analyzer [RCS1036](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1036) by default ([PR](dotnet/roslynator#1671)) - Use analyzer [RCS0063](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0063) instead ### Removed - Remove legacy config options ([PR](dotnet/roslynator#1304)) Commits viewable in [compare view](dotnet/roslynator@v4.13.1...v4.14.0). </details> Updated [Roslynator.Formatting.Analyzers](https://github.com/dotnet/roslynator) from 4.13.1 to 4.14.0. <details> <summary>Release notes</summary> _Sourced from [Roslynator.Formatting.Analyzers's releases](https://github.com/dotnet/roslynator/releases)._ ## 4.14.0 ### Added - [CLI] Add support for GitLab analyzer reports ([PR](dotnet/roslynator#1633)) ### Fixed - Fix analyzer [RCS1264](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1264) ([PR](dotnet/roslynator#1666)) - Fix analyzer [RCS1229](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1229) ([PR](dotnet/roslynator#1667)) - Fix analyzer [RCS1250](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1250) ([PR](dotnet/roslynator#1652) by @aihnatiuk) - Fix analyzer [RCS1260](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1260) ([PR](dotnet/roslynator#1668)) - Fix analyzer [RCS1105](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1105) ([PR](dotnet/roslynator#1669)) - Fix analyzer [RCS1260](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1260) ([PR](dotnet/roslynator#1672)) ### Changed - Disable analyzer [RCS1036](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1036) by default ([PR](dotnet/roslynator#1671)) - Use analyzer [RCS0063](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0063) instead ### Removed - Remove legacy config options ([PR](dotnet/roslynator#1304)) Commits viewable in [compare view](dotnet/roslynator@v4.13.1...v4.14.0). </details> Updated [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 3.1.2 to 3.1.3. <details> <summary>Release notes</summary> _Sourced from [xunit.runner.visualstudio's releases](https://github.com/xunit/visualstudio.xunit/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/xunit/visualstudio.xunit/commits). </details> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

PR Details
Add Support for ExecuteDelete, ExecuteUpdate, ExecuteDeleteAsync, and ExecuteUpdateAsync in MockQueryable Library
Description
This PR introduces support for mocking the ExecuteDelete, ExecuteUpdate, ExecuteDeleteAsync, and ExecuteUpdateAsync methods in the MockQueryable library. These methods allow for both synchronous and asynchronous deletion and updating of entities using expressions, now fully integrated into the mocking process for EF Core's IQueryable-based testing.
Changes include:
Related Issue
This PR addresses the need to support EF Core 7’s new ExecuteDelete/ExecuteDeleteAsync and ExecuteUpdate/ExecuteUpdateAsync methods in unit tests, enabling developers to simulate bulk delete and update operations without direct access to the database.
Related Issue: #66
How Has This Been Tested
Checklist