-
Notifications
You must be signed in to change notification settings - Fork 73
Description
@timyhac Is there a reason why this constructor of the Tag class was made internal? I would like to write test for custom Tag-classs that use the real Tag class.
And then pass a mock for the INative for local testing without a device for both the tag + any encoding or decoding.
But as the constructor is internal and the class no longer has an interface. This is now unnecessary complicated because the design ingores the open-closed principal.I also don't understand why the ITag interface was deprecated and why the Tag class does not implement this interface. Could you please elaborate?
Originally posted by @sebastian-zitzelsberger in #406
Hi @sebastian-zitzelsberger - apologies if I am misinterpreting your query; to me it seems that the core requirement is to be able to mock the device you're connecting to - which is unrelated to #406 (hence why I've moved this conversation to a new issue).
The approach I would take is to develop the abstraction point within your application, and provide one class that consumes libplctag.NET, and another that provides the mocking behaviour. Something like this example.