how can i mockk bitmap?
# mockk
s
how can i mockk bitmap?
l
What do you mean?
s
val bitmap = mockk<Bitmap>
something like that
or init
l
Mockk is used to simulate functionality of a class, I don't think one can mock an image
As in create a simulated image
Could you give us some more of the code you're using as example?
s
ok... the problem is that with groovy i could do this
new Bitmap()
and i cant do that with kotlin, then i tried mockk it
l
why can't you do that in kotlin?
If you can do it in groovy, you probably can in kotlin
s
it's showing me this error
Cannot access '<init>': it is public/*package*/ in 'Bitmap'
then i use createBitmap but it crash while testing
Method createBitmap in android.graphics.Bitmap not mocked
l
Perhaps you can mock it, then?
s
it works now. Sorry Leonarod, dunno how i called it before :S
it crashed
l
You can mock the method, I mean
s
yes
but i could do this
val bitmap = mockk<Bitmap>()
my mistake. Sorry
idk how i declared it before
405 Views