-
Notifications
You must be signed in to change notification settings - Fork 0
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
Tests #5
Tests #5
Conversation
LegendAF
commented
Sep 24, 2024
•
edited
Loading
edited
- Refactor code to make it easier to test.
- Write tests
- Bring some of the naming in line with dart conventions.
lib/src/models/media_object.dart
Outdated
static TenorMediaObjectDimensions dimensionsfromJson( | ||
List<int> dimensions, | ||
) { | ||
return TenorMediaObjectDimensions.fromJson({'dims': dimensions}); | ||
} | ||
|
||
static List<double> dimensionsToJson(TenorMediaObjectDimensions dimensions) { | ||
return [dimensions.width, dimensions.height]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSON was bad here. It was doing like:
{
"dims:" {
"dims": [100, 200],
}
}
and my OCD could not allow it
lib/src/http_client.dart
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was having a hard time trying to test TenorResponse.fetchNext()
because it contained getGifs
which contained serverRequest
. This nested structure made it very hard/impossible to test. With this new setup it is much easier to mock those functions as needed.
Pull Request Test Coverage Report for Build 11037699108Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍