Skip to content

Added exception extensions for ValueTask without return type#864

Closed
marcselman wants to merge 31 commits intonsubstitute:mainfrom
marcselman:main
Closed

Added exception extensions for ValueTask without return type#864
marcselman wants to merge 31 commits intonsubstitute:mainfrom
marcselman:main

Conversation

@marcselman
Copy link

The current implementation of the ThrowsAsync and ThrowsAsyncForAnyArgs extension methods work for work for Task (void), Task<T> and ValueTask<T> but not for ValueTask (void).

This change implements the extension methods and includes all related tests.

jmartschinke and others added 28 commits May 7, 2024 14:21
…the test TestSubstituteWithAsynchronousHandler does not work because of the bug
… unit tests to verify error conditions

* Rename unit tests with better description
* Fix unit test failure due to orphaned argument spec when previous setup throws
…s when AnyType is a generic argument in the out or ref parameter
Ability to mock protected methods with and without return value
Enable nullability for public api
…nt-handlers-return-instantly

Bugfix/async event handlers return instantly
…pe-matching

Fix matching generic calls with AnyType when the generic argument is also a generic argument in return type, out or ref parameter
Feature: allow interception of any generic method call when using Arg.AnyType
@dtchepak
Copy link
Member

Thanks @marcselman ! Would you be able to rebase this on to latest main please?
(If you could also run a dotnet format over after the rebase it would be greatly appreciated! 🙇 )

@marcselman
Copy link
Author

@dtchepak Rebased and formatting fixed!

@dtchepak
Copy link
Member

Thanks @marcselman ! For some reason additional commits are listed. I've tried tidying up the commit history. Could you please take a look and make sure it looks like your changes are intact on this branch? #873

@marcselman
Copy link
Author

Hi @dtchepak. I checked the branch against my earlier commit and those are the exact changes.

@dtchepak
Copy link
Member

Thanks @marcselman . Will close this and merge #873 once I get the required reviews. Alternatively you can re-open and update this PR with the changes from 873 and then I can review and merge.

@dtchepak dtchepak closed this Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants