dart-lang / mockito

Mockito-inspired mock library for Dart
https://pub.dev/packages/mockito
Apache License 2.0
623 stars 160 forks source link

How are we supposed to use any with non null parameters? #746

Closed takla21 closed 2 months ago

takla21 commented 2 months ago

I'm trying to write a test in which I'm trying to mock a method with a non-null parameter. However, I can't compile when I'm trying to use any for that non-null parameter.

image image

Is there something I'm missing or it's a bug?

srawlins commented 2 months ago

No parameter of a mock class's method's should be non-nullable. Can you show how you generated your mock class with @GenerateNiceMocks?

takla21 commented 2 months ago

Ok I was a dummy here. I didn't read the generated mock part. Sorry for wasting your time