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
Hello,
I'm trying to unit test my solution using Moq framework, but since Moq cannot mock non-virtual type members I always get an Unsupported Error Type. Is there any work around for Mock MangoPayApi services and the apis within ?
I found a couple of possible solutions.
One could be making the class virtual (devlooped/moq#961)
The other one is to create interfaces for this api classes
Thank you
The text was updated successfully, but these errors were encountered:
I created a dot net core library some years ago, before Mangopay released the mangopay2-net-sdk.
I based my work on their previous library, which targeted old .NET framework, I had to do some refactoring to apply best practices and, in my project, you can find I used interfaces, exactly for that reason (unit test with mocking and moq). In the docs, you can find that you can easily do basic mocking...
BTW, at that point (using that library on prod) I sent the code to Mangopay, but nobody answered, that's why I published it here in GitHub.
Hello,
I'm trying to unit test my solution using Moq framework, but since Moq cannot mock non-virtual type members I always get an Unsupported Error Type. Is there any work around for Mock MangoPayApi services and the apis within ?
I found a couple of possible solutions.
One could be making the class virtual (devlooped/moq#961)
The other one is to create interfaces for this api classes
Thank you
The text was updated successfully, but these errors were encountered: