www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Mocking framework mockeD

reply Eugene Wissner <belka caraus.de> writes:
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
Jul 29 2020
parent reply Martin Tschierschke <mt smartdolphin.de> writes:
On Wednesday, 29 July 2020 at 08:25:34 UTC, Eugene Wissner wrote:
 I'm happy to announce a new mocking library developed at 
 Funkwerk.
[...]
 https://github.com/funkwerk/mocked
By searching for the exact definition of Mocking Framework I found the Wikipedia Page for it, so you might want to add your framework there, too: https://de.wikipedia.org/wiki/Mocking_Framework Beside the frameworks for the other languages. Actually I am searching for the best way to make unit tests for a small program, reading values from a pdf converted to txt and than writing them into mysql. So I might just use your work. Thank you. Best regards mt.
Jul 29 2020
parent Atila Neves <atila.neves gmail.com> writes:
On Wednesday, 29 July 2020 at 09:49:36 UTC, Martin Tschierschke 
wrote:
 On Wednesday, 29 July 2020 at 08:25:34 UTC, Eugene Wissner 
 wrote:
 I'm happy to announce a new mocking library developed at 
 Funkwerk.
[...]
 https://github.com/funkwerk/mocked
By searching for the exact definition of Mocking Framework I found the Wikipedia Page for it, so you might want to add your framework there, too: https://de.wikipedia.org/wiki/Mocking_Framework Beside the frameworks for the other languages. Actually I am searching for the best way to make unit tests for a small program, reading values from a pdf converted to txt and than writing them into mysql. So I might just use your work. Thank you. Best regards mt.
See also: https://github.com/atilaneves/unit-threaded#mocking
Jul 29 2020