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

Cannot unit test Chopper classes as they don't support equality #290

Closed
guymclean opened this issue Sep 2, 2021 · 2 comments
Closed

Cannot unit test Chopper classes as they don't support equality #290

guymclean opened this issue Sep 2, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@guymclean
Copy link

We have an interceptor that appends headers to the request based on dynamic values, and we would like to unit test this interceptor. Currently we are unable to do so because the Request class (and Response) do not override == and hashCode. This means that even though the two objects, expected and actual have the same fields, the tests fail because they are different instances. Would it be possible to include this in a future release (the equatable package might help) so that users of the library are able to test their code? Thanks

@techouse techouse added the enhancement New feature or request label Feb 18, 2023
@techouse techouse self-assigned this Feb 18, 2023
@techouse
Copy link
Collaborator

Great idea! I'll look into implementing equatable

techouse added a commit to techouse/chopper that referenced this issue Feb 18, 2023
@techouse
Copy link
Collaborator

@guymclean can you check if #410 implements everything you wanted?

JEuler pushed a commit that referenced this issue Feb 22, 2023
* #290 implement Equatable

* ➕ add faker and data_fixture_dart as dev dependencies

* ✅ add Request equatability test

* ✅ add Response equatability test

* 🔥 Remove some obsolete equatables

* 🔥 Remove some obsolete equatables

* ✅ add PartValue equatability test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants