I am just starting in with the D2 programming language. I love the fact that unit testing is part of the language itself but I can't seem to find any mock object libraries for it. Is there a standard one out there?
In mocking, the dependencies are replaced by closely controlled replacements objects that simulate the behavior of the real ones. There are three main possible types of replacement objects - fakes, stubs and mocks.
mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used.
Mock objects are a type of test double. They replace production objects to make for easier and more reliable testing practices. If developers want to use mock objects as part of their testing process, they need to be aware of potential pitfalls that can harm their applications' code.
The only mock object library I know of is DMocks, but it is abandoned. It may not compile with recent compiler versions. Maybe BlackHole, WhiteHole and AutoImplement from std.typecons will help you to some extent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With