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
Refactoring tests for better readability #7
Conversation
On the
I think it should be (following your line of thought):
|
@RuiAAPeres hawk eyes! spot on with that comment, thanks for highlighting it. I changed that. |
Looking at:
Specially:
It's slight misleading, because the predicate (
You also:
It should be:
|
@RuiAAPeres you're right on both ends. This was me making sense of "maybe", and not removing that part. Just let me know please if you see some more inconsitencies - read through them again and hopefully not missed much else. |
In some cases you use:
But in others:
|
@RuiAAPeres great on noticing that as well 👍 I've updated this to be consistent with the naming in the tests - so for the first two tests left it as In those cases changing |
🍰 |
Refactoring tests for better readability
I use tests as to understand what a project does - this is a refactor to make that understanding easier.
Using the given / when / then naming convention, as well as (when possible) one assert per test.
After doing this refactor, reading over the tests gives me a good idea of what the extensions do. (and on that note I'm wondering if "maybe" expresses what it does... but yet to find a better name):