想象一下,我正在对Meyers diff算法实现进行单元测试:我将[1, 2, 3, 4]
作为第一个数据快照,将[2, 1, 4 ,3]
作为第二个数据快照。实现本身会调度更新某些侦听器a-la listener.onMoved(fromPosition: 1, toPosition: 2)
。这是两个变体:
listener.onMoved(fromPosition: 1, toPosition: 0); // [2, 1, 3, 4]
listener.onMoved(fromPosition: 3, toPosition: 2); // [2, 1, 4, 3]
,然后
listener.onMoved(fromPosition: 3, toPosition: 1); // [1, 4, 2, 3]
listener.onMoved(fromPosition: 2, toPosition: 0); // [2, 1, 4, 3]
有没有办法检查这些链条中的任何一条是否在Dart的Mockito中执行?