I'm writing an API using echo and adding tests to it as I go, and I've found a problem that I don't know how to solve
In every single request that requires the binding of a body to a struct I have to add a test case for if the binding fails
var loginInfo model.UnsafeUser
if err := echo.Bind(&loginInfo); err != nil {
return echo.JSON(http.StatusBadRequest, "Bad username and password combination")
}
Something like this bit of code above, do you guys have any solution for it other then just adding the same test to every single test file?
I'm writing an API using echo and adding tests to it as I go, and I've found a problem that I don't know how to solve
In every single request that requires the binding of a body to a struct I have to add a test case for if the binding fails
Something like this bit of code above, do you guys have any solution for it other then just adding the same test to every single test file?