Lukasz Kalnik
12/28/2021, 6:14 PMSuccess(Either.Left(IOError(cause=com.google.gson.stream.MalformedJsonException)))
I want to assert certain things:
• that the contents of Success
is of type Left
• that the contents of Left
is of type IOError
• that the cause
is of type MalformedJsonException
sam
12/28/2021, 6:23 PMLukasz Kalnik
12/28/2021, 6:25 PMsam
12/28/2021, 6:25 PMLukasz Kalnik
12/28/2021, 6:25 PMsam
12/28/2021, 6:26 PMLukasz Kalnik
12/28/2021, 6:27 PMcause
property type?sam
12/28/2021, 6:27 PMval v = either.shouldBeLeft()
v shouldBe "whatever"
or
either.shouldBeLeft().shouldBe("whatever")
Lukasz Kalnik
12/28/2021, 6:27 PMMalformedJsonException
?cause
propertysam
12/28/2021, 6:28 PMeither.shouldBeLeft().cause.shouldBeInstanceOf<MalformedJsonException>()
Lukasz Kalnik
12/28/2021, 6:28 PM