danikf / tik4net

Manage mikrotik routers with .NET C# code via ADO.NET like API or enjoy O/R mapper like highlevel api.
Apache License 2.0
178 stars 94 forks source link

Mocking commands #54

Open AsafMag opened 6 years ago

AsafMag commented 6 years ago

I would really like to mock ITikConnection.Save and many other functions but they are implemented as extension methods. Is that really necessary? What are the reasons for implementing most of the library as extension methods?

danikf commented 6 years ago

Hi, reasons for this approach:

How to test your code (just brainstorming):

BTW: I have plan to create some kind of mikrotikwrapper class (wraps connection) with easy to use API (like mikrotik.Users.Create(name, ...); and I will face the same problem there - so - may be, I will recognize I am wrong :-)

D