Hexa
03/29/2019, 11:55 PMany()
as argument in the every
part of my tests and then in the verify
part I checked the exactly value of the argument like this every { car.drive(any()) } returns Outcome.OK
verify(exactly = 1) {
car.drive(Direction.SOUTH)
}
. I did this because it saves me a lot of typing (and maybe it makes the code more readable as it's shorter) when the argument I'm passing is too long for example: https://gist.github.com/rinnegan/bd8928a750fab4eaebf89652972c7647#file-using-any-L16. So it is okay to write my tests like this? Or do I need to avoid using any()
and be very explicit and specify the exact argument?LeoColman
03/30/2019, 12:45 AMdave08
04/01/2019, 8:02 AMHexa
04/05/2019, 11:48 PMdave08
04/06/2019, 5:41 PMHexa
04/06/2019, 9:57 PMdave08
04/08/2019, 10:29 AM