Join Slack
Powered by
Hey How to test substring function value ```val ti...
# mockk
v
Vivek Modi
10/21/2021, 2:54 PM
Hey How to test substring function value
Copy code
val time = item.time?.substring(0, 10)
g
gildor
10/22/2021, 2:58 AM
Why do you need any kind of mocking for this? Even if item is mocked, you can just do every { item.time } returns “12345678901234” So you know that substring will be “1234567890"
v
Vivek Modi
10/27/2021, 10:13 AM
okk thanks
2
Views
Open in Slack
Previous
Next