Luciano de Sousa Pereira.
Brazilian.
Bacharel degree in Computer Engineering.
Full Stack Developer with 5 years of experience in multiple frameworks and programming languages.
Unfortunately, I've had a bad experience in the past that made me paranoic about the possibility of a valid value being considered invalid. Since then, I've tested it as well in my Theories. I know I am breaking the a TDD rule, but it was only my vision as developer.
I will edit my posts to let very clear that this approach was my decision.
Thanks anyway.
What about making the test "invertible", by adding a bool parameter which will swap failure and success around if set to true? That way the test would still exist and be green
Luciano de Sousa Pereira.
Brazilian.
Bacharel degree in Computer Engineering.
Full Stack Developer with 5 years of experience in multiple frameworks and programming languages.
to make it clear, have separate SUCCESS and FAIL test is a good thing, like:
expect that all users with names less than 20 chars to be accepted
expect all users with names more than 20 chars to be rejected (rejection is accepted so it's our GREEN indicator).
best to do one test per fact, e.g. test the 20 char limit, test if there's at least a special char in the password and have multiple values for that test that should pass.
same way give multiple values for the test where the failing condition is tested, e.g.:
fact_password_without_special_chars_should_be_rejected
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Unfortunately, I've had a bad experience in the past that made me paranoic about the possibility of a valid value being considered invalid. Since then, I've tested it as well in my Theories. I know I am breaking the a TDD rule, but it was only my vision as developer.
I will edit my posts to let very clear that this approach was my decision.
Thanks anyway.
What about making the test "invertible", by adding a bool parameter which will swap failure and success around if set to true? That way the test would still exist and be green
good idea.
I've made something similar but using enum.
to make it clear, have separate SUCCESS and FAIL test is a good thing, like:
best to do one test per fact, e.g. test the 20 char limit, test if there's at least a special char in the password and have multiple values for that test that should pass.
same way give multiple values for the test where the failing condition is tested, e.g.:
fact_password_without_special_chars_should_be_rejected