Dart Mockito在第一次,第二次,... n次调用时返回不同的值

时间:2020-06-07 15:49:18

标签: flutter dart mockito

在Java Mockito中,您可以为每个调用模拟一个不同的返回值,如下所示:

when(myMock.doTheCall())
   .thenReturn("You failed")
   .thenReturn("Success");

或者像这样:

when(myMock.doTheCall()).thenReturn("Success", "you failed");

来源:Simulate first call fails, second call succeeds

我想知道如何在Dart Mockito中实现相同的目标。我找不到相关的文档

0 个答案:

没有答案