Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of Interfaces in the API #11

Closed
dcamdupe opened this issue Jun 26, 2015 · 2 comments
Closed

Lack of Interfaces in the API #11

dcamdupe opened this issue Jun 26, 2015 · 2 comments

Comments

@dcamdupe
Copy link

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.

@kexline4710
Copy link

Hi @dcamdupe!

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!

@dcamdupe
Copy link
Author

Thanks, glad to see them going in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants