Spent like a month trying to figure out what's wrong with some of my classes.
Turned out, did not include an important import. How come it was not properly detected? Because I used to write stuff like
and then verify actual. But what I did not verify was its type.
The right thing to do in tests is to have this:
Turned out, did not include an important import. How come it was not properly detected? Because I used to write stuff like
val actual = sut.myMethod(a,b,c)
and then verify actual. But what I did not verify was its type.
The right thing to do in tests is to have this:
val actual: TheTypeWeExpect = sut.myMethod(a,b,c)