You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's slightly more readable and less verbose than It.IsAny<> syntax.. Readable code is good 👍
Async methods are extremely common and mocking them is common as well.
It's purely syntactic sugar. It breaks nothing.
Code completion will be easier. Right now you need to do it in two steps (IsAny + CancellationToken in generic params).
It class is static, so you cannot add an extension method with similar behaviour on your own.
The text was updated successfully, but these errors were encountered:
mjamro
changed the title
Adding support for matching cancellation tokens with It class. (It.IsCancellationToken())
Explicit support for matching cancellation tokens with It class. (It.IsCancellationToken())
May 5, 2024
Category
Describe the feature
When mocking async methods that require a cancellation token you can use
It.IsAny<CancellationToken>()
syntax like this:I propose adding a new method to
It
class for matching cancellation tokens, that does exactly the same:Rationale:
It.IsAny<>
syntax.. Readable code is good 👍It
class is static, so you cannot add an extension method with similar behaviour on your own.The text was updated successfully, but these errors were encountered: