Replies: 1 comment
-
I think there are 2 ways to handle this. There are paid mocking frameworks like TypeMock or JustMock that can mock extension methods. Other option is to mock the eventaggregator class's PublishAsync
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is not to criticize or anything,
As I wrote writing some unit tests with Moq on my project, I got an error stating that the
PublishOnBackgroundThreadAsync
method was an extension method, which could not be mocked.After a quick look to the extension method, I was wondering what would have prevented you from having those methods defined within the
EventAggregator
?By the way, if someone has already encountered this error and has a quick workaround, that'd be nice to share :)
Thanks for all the hard work anyway !
Beta Was this translation helpful? Give feedback.
All reactions