You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The unittest mock library uses strings to represent method calls. e.g.
foo.when(callsTo('fum')).thenReturn(...);
problem is when I want to rename fum then the IDE won't pick up my mocked method calls so I'll have to manually change them.
Issue #13056 would provide a solution. Another option is a mockito style approach which I would imagine could be implemented today using noSuchMethod. e.g.
when(foo.fum()).thenReturn(...);
or
foo.when((f) => foo.fum()).thenReturn(...); // i.e. when calls the function with a second impl of Foo that captures the behaviour. Assuming you can dynamically implement an interface
This issue was originally filed by @Andersmholmgren
The unittest mock library uses strings to represent method calls. e.g.
foo.when(callsTo('fum')).thenReturn(...);
problem is when I want to rename fum then the IDE won't pick up my mocked method calls so I'll have to manually change them.
Issue #13056 would provide a solution. Another option is a mockito style approach which I would imagine could be implemented today using noSuchMethod. e.g.
when(foo.fum()).thenReturn(...);
or
foo.when((f) => foo.fum()).thenReturn(...); // i.e. when calls the function with a second impl of Foo that captures the behaviour. Assuming you can dynamically implement an interface
http://stackoverflow.com/questions/20768280/refactor-friendly-mocking-in-dart
The text was updated successfully, but these errors were encountered: