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
The text was updated successfully, but these errors were encountered:
a10r
changed the title
Fix S6966 FP/FN: Should not suggest Moq's RaiseAsync in async test method
Fix S6966 FP: Should not suggest Moq's RaiseAsync in async test method
Nov 25, 2024
We might need to do a bit more than just add it to the exclusion list.
I am thinking about checking if the event handler returns a task; however, I am not sure this would add value to the rule.
sebastien-marichal
changed the title
Fix S6966 FP: Should not suggest Moq's RaiseAsync in async test method
Fix S6966 FP: Mock.Raise from Moq should be ignored
Nov 28, 2024
Description
In an async test method, S6966 is raised for Moq's Mock.Raise method, suggesting to use RaiseAsync instead.
RaiseAsync does not work for normal events and requires a Task-returning event signature instead: https://github.com/moq/moq/pull/1313.
I've seen that this rule has a list of exceptions for specific APIs, so maybe it would make sense to add this case to that list.
Repro steps
Consider this:
Expected behavior
Should not suggest RaiseAsync.
Actual behavior
Suggests to use RaiseAsync instead of Raise.
Known workarounds
--
Related information
The text was updated successfully, but these errors were encountered: