mailjet / mailjet-apiv3-dotnet

[API v3] Official Mailjet API v3 .NET wrapper
https://dev.mailjet.com
MIT License
74 stars 31 forks source link

Promote MailJetClient Extenisons to Interface #79

Closed rgarrison12345 closed 2 years ago

rgarrison12345 commented 3 years ago

I am attempting to do unit testing with the sendtransactionalemailAsync methods on IMailJetClient using the Moq library. I am trying to setup the mock object on IMailJetClient. However this fails because these methods are extension methods on IMailJetClient interface. I think it wouldn't be too much of a change by taking the methods on those extensions, and defining them in the interface. Then implementing them on MailJetClient concrete class. Maybe for those who have written their own class that implements on IMailJetClient,

maffelbaffel commented 2 years ago

Same problem. We currently work around this issue by wrapping the class in another interface provided by us.

rgarrison12345 commented 2 years ago

@maffelbaffel I created a PR to address this issue https://github.com/mailjet/mailjet-apiv3-dotnet/pull/81 hopefully it will be taken into consideration