Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What mock object libraries are there available for D?

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?

like image 329
Rob Young Avatar asked Jan 25 '11 23:01

Rob Young


People also ask

How many types of mock objects are 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.

What are mocking libraries?

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.

What are mock objects in testing?

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.


2 Answers

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.

like image 158
Nekuromento Avatar answered Sep 30 '22 19:09

Nekuromento


  • DMocks-revived is a mock object framework for the D Programming Language, written also in D.
  • dunit (nomad) Advanced unit testing toolkit.
like image 23
o3o Avatar answered Sep 30 '22 18:09

o3o