A technique to mock "static interfaces" (e.g. isInputRange)

Atila Neves via Digitalmars-d digitalmars-d at puremagic.com
Thu May 26 02:42:59 PDT 2016


On Wednesday, 25 May 2016 at 22:07:07 UTC, Robert burner Schadek 
wrote:
> +1 having a look at AutoImplement
>
> For testing ranges, I usually use 
> https://github.com/dlang/phobos/blob/master/std/internal/test/dummyrange.d
> even though its internal ;-)

Internal, and not really a mock. I used a range as an example - 
anything with an accompanying interface would be supported.

> anyway, more and better testing always good.

Indeed :)

>
> p.s. I think at some point we have to build some (the perfect) 
> mocking framework with dependency injection and all the other 
> awesome stuff. But before that can happen we have to lose the 
> fear of classes and OO. Please no OT!

What's wrong with dmocks revived (I've never used it)? I'm not 
afraid of classes, I was just trying to extend mocking to static 
interfaces since there's so much emphasis on them in D. Regular 
mocking is boring and easily doable :P

Atila




More information about the Digitalmars-d mailing list