Closed avdhootu27 closed 2 months ago
And one more thing, I am not able to use 'any' as parameter for insertFolder while mocking
So I created MockMyDatabaseWrapper as:
Definitely don't do that.
Please read in the README how to set up mocks.
Thanks for this, but how to mock static methods?
I am trying to mock a static method from the class MyDatabase which returns Future. So I created MockMyDatabaseWrapper as:
and in test I am mocking it as:
but at line
when(await mockMyDatabaseWrapper.insertFolder(testFolder)).thenReturn(true);
I am getting an error:The following _TypeError was thrown running a test: type 'Null' is not a subtype of type 'Future<bool>'
Can anyone please tell me what I am doing wrong here?