I have a validation method like this
def validate(a, b, c, d, e, f): Boolean = {
val rs1 = check1(a, b)
val rs2 = check2(c, d)
val rs3 = check3(e, f)
rs1 && rs2 && rs3
}
I have tests for all of the smaller methods check1
, check2
, and check3
and I want to test the big method validate
also. But to test it, I imagine I have to write tests for all of the cases like:
- all 3 checks succeed
check1
failscheck2
fails- ...
not to mention I will have to provide suitable sets of parameters (a, b, ...).
So what is the best practice for this situation or should I just skip testing the validate
method?