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
Making requests and parsing responses from the API is very similar between QBD and QBO. These similarities should be extracted. For instance, here is the general process for making a request:
Perform an HTTP request, building parameters if necessary
Check the response. If the response is anything but a 200, throw an error
If a 200, parse the response data into objects
This similarity (and simplicity) is not reflected in the individual ServiceBases for each service type.
Furthermore, the code to create requests and parse responses is not very well tested. There are some tests, but these methods are contained in a superclass and are private methods, and as such, testing them as they are doesn't feel right. We should extract this code to Request and Response objects so that they can be tested in isolation.
Because there are differences between the different service types for building parameters and parsing response data, there should be individual Request and Response classes for each service type, but they should delegate to "parent" Request and Response classes (which should be tested on their own).
The text was updated successfully, but these errors were encountered:
Making requests and parsing responses from the API is very similar between QBD and QBO. These similarities should be extracted. For instance, here is the general process for making a request:
This similarity (and simplicity) is not reflected in the individual ServiceBases for each service type.
Furthermore, the code to create requests and parse responses is not very well tested. There are some tests, but these methods are contained in a superclass and are private methods, and as such, testing them as they are doesn't feel right. We should extract this code to Request and Response objects so that they can be tested in isolation.
Because there are differences between the different service types for building parameters and parsing response data, there should be individual Request and Response classes for each service type, but they should delegate to "parent" Request and Response classes (which should be tested on their own).
The text was updated successfully, but these errors were encountered: