Mocking framework mockeD

Eugene Wissner belka at caraus.de
Wed Jul 29 08:25:34 UTC 2020


I'm happy to announce a new mocking library developed at Funkwerk.

Funkwerk maintained dmocks for some time, but dmocks had some 
design limitations,  among others, that it relies on dynamic 
casts and runtime type information (by use of typeid).
It was possible to construct expectations that aren’t really 
well-typed. And if dmocks doesn’t catch such problems internally, 
they cause runtime errors that are difficult to track. Over time 
we fixed a bunch of related bugs, but the question raised, 
whether we can generate more code since the most information 
needed to build a mock is given at compile-time. After the 
initial draft and some internal testing, I finished the first 
full-featured version and am releasing mockeD 1.x.

- mockeD catches type errors at compile-time.
- has almost the same API as dmocks
- supports only mocking by inheritance. Structs, final classes, 
final methods aren’t mockable.
- mockeD provides a separate stub API. Stubs can everything mocks 
can, but the calls on stubs aren’t verified at the end.

https://github.com/funkwerk/mocked


More information about the Digitalmars-d-announce mailing list