I'm conflicted on the table driven approach as well. But I think that for testing "error cases" is the best. You just list them all and done. Also it saves a lot of code duplication.
I tend not to use the test tables for the "ok" response, so that I can dig into the response and check everything's how it's supposed to be.
I think there's a conflict in Go community too when it comes to writing a program, duplication becomes a second-citizen but in testing duplication not tolerated.
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.
I'm conflicted on the table driven approach as well. But I think that for testing "error cases" is the best. You just list them all and done. Also it saves a lot of code duplication.
I tend not to use the test tables for the "ok" response, so that I can dig into the response and check everything's how it's supposed to be.
I think there's a conflict in Go community too when it comes to writing a program, duplication becomes a second-citizen but in testing duplication not tolerated.