mocked 0.0.2

A mocking framework for the D programming language


To use this package, run the following command in your project's root directory:

MockeD

CI License codecov Dub version Dub downloads

A mocking framework for the D programming language.

import mocked;

class Dependency
{
    string authorOf(string phrase)
    {
        return null;
    }
}

enum string phrase = "[T]he meaning of a word is its use in the language.";
enum string expected = "L. Wittgenstein";

Mocker mocker;
auto builder = mocker.mock!Dependency;

builder.expect
    .authorOf("[T]he meaning of a word is its use in the language.")
    .returns(expected);

auto dependency = builder.getMock;

assert(dependency.authorOf(phrase) == expected);
Authors:
  • Eugen Wissner
Dependencies:
none
Versions:
0.0.2 2020-May-20
0.0.1 2020-May-19
~master 2020-May-20
Show all 3 versions
Download Stats:
  • 0 downloads today

  • 4 downloads this week

  • 4 downloads this month

  • 4 downloads total

Score:
1.7
Short URL:
mocked.dub.pm