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
The API provides a reasonable interface to Braintree.
However none of the classes for this are interfaced. This makes it hard to apply Dependancy Injection and to mock the classes. If they can't be mocked then unit testing is substantially hampered.
In order to unit test a series of calls to the Braintree API, I'd need to implement a Facade that is interfaced, just so we can mock the calls to the API. It ends up being a lot of plumbing being written due to an oversight.
For more complex scenarios, unit testing is a must. It's certainly a best practice for current software development practices.
The text was updated successfully, but these errors were encountered:
You make an excellent point. This was already a reported concern, so we implemented interfaces and released them in version 2.51.0. Thank you for pointing this out!
The API provides a reasonable interface to Braintree.
However none of the classes for this are interfaced. This makes it hard to apply Dependancy Injection and to mock the classes. If they can't be mocked then unit testing is substantially hampered.
In order to unit test a series of calls to the Braintree API, I'd need to implement a Facade that is interfaced, just so we can mock the calls to the API. It ends up being a lot of plumbing being written due to an oversight.
For more complex scenarios, unit testing is a must. It's certainly a best practice for current software development practices.
The text was updated successfully, but these errors were encountered: