Move the AmiiboMockClient client type to an internal scope
#10
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
After careful consideration, it is required to move the
AmiiboMockClientclient type out of the public scope of the library, as this is a type that only should be used for testing purposes by the SPM package.Explanation
It was assumed that exposing the
APIClientprotocol publicly would be an anti-pattern, so for that reason theAmiiboClientenumeration type that provides both amockand aliveclient, each case representing either aAmiiboMockClientand aAmiiboLiveClientclient types, is being expose by the library. After a review of this particular decision, the conclusion is that theAmiiboClientenumeration and theAmiiboMockClientshould not be exposed at all.Posible solution
To improve the API design of the public interface, the following actions should be done:
APIClientprotocol asAmiiboClient;AmiiboClientprotocol publicly;AmiiboClientenumeration from the library;AmiiboMockClientclient type to the tests target;AmiiboServiceservice type.Merged in PR #12.