Can someone help me with the problem I keep facing with value classes? I have a simple class that ho...
m
Can someone help me with the problem I keep facing with value classes? I have a simple class that holds multiple fields, but one of the is the "Duration" value class of kotlin. when I try to mockk it, (v1.12.2) I keep getting classcastexceptions from Long to Duration
Copy code
every { someClass.duration } returns 30.minutes
I can't run this
e
m
yeah I saw this as well. It is what it is, but now I literally have no idea how to properly test this 🤔
e
does
Copy code
every { someClass.duration as Any? }.returns(30.minutes as Any?)
work? (just a thought, there's a good chance that doesn't help) otherwise you'll just have to avoid mocking by using the real object or a writing a fake