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

Tests #5

Merged
merged 19 commits into from
Sep 25, 2024
Merged

Tests #5

merged 19 commits into from
Sep 25, 2024

Conversation

LegendAF
Copy link
Collaborator

@LegendAF LegendAF commented Sep 24, 2024

  • Refactor code to make it easier to test.
  • Write tests
  • Bring some of the naming in line with dart conventions.

Comment on lines 41 to 49
static TenorMediaObjectDimensions dimensionsfromJson(
List<int> dimensions,
) {
return TenorMediaObjectDimensions.fromJson({'dims': dimensions});
}

static List<double> dimensionsToJson(TenorMediaObjectDimensions dimensions) {
return [dimensions.width, dimensions.height];
}
Copy link
Collaborator Author

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

Copy link
Collaborator Author

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.

@coveralls
Copy link
Collaborator

coveralls commented Sep 24, 2024

Pull Request Test Coverage Report for Build 11037699108

Warning: 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

  • 54 of 54 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+93.6%) to 100.0%

Totals Coverage Status
Change from base Build 11020280103: 93.6%
Covered Lines: 172
Relevant Lines: 172

💛 - Coveralls

@LegendAF LegendAF marked this pull request as ready for review September 24, 2024 17:41
@LegendAF LegendAF requested a review from a team as a code owner September 24, 2024 17:41
Copy link

@josh-flyclops josh-flyclops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@LegendAF LegendAF merged commit e8f687f into main Sep 25, 2024
1 check passed
@LegendAF LegendAF deleted the tickets/FL-1043 branch September 25, 2024 17:02
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

Successfully merging this pull request may close these issues.

3 participants