2

So far all the mocking libraries I've seen in dart (unittest/mock, dartmocks) use strings to represent the 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.

Anyone aware of any that work with actual method calls (foo.fum())? i.e. similar to mockito etc in Java

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
Anders
  • 1,337
  • 1
  • 8
  • 17

2 Answers2

3

I wrote a tool called mockito to make this a bit easier. It supports refactoring well.

Will
  • 24,082
  • 14
  • 97
  • 108
Dmitriy
  • 46
  • 2
  • Please do not post links to your own work without proper disclaimers; make sure that even properly disclaimed links make up a fairly small proportion of your contributions, not 2/2 posts. – Nathan Tuggy May 11 '15 at 02:11
  • I do use mockito now. It has made a huge improvement to mocking in dart. – Anders May 11 '15 at 02:16
0

Not yet.

You can star Symbols create a tooling gap

It's probably a good idea to create a new issue for your requirement as it's different enough.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • 1
    Thanks @GünterZöchbauer. Created [a new issue](https://code.google.com/p/dart/issues/detail?id=15793&thanks=15793&ts=1388004322) as you suggested. – Anders Dec 25 '13 at 20:49