mocked 0.0.1

A mocking framework for the D programming language


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

Manual usage
Put the following dependency into your project's dependences section:

MockeD

CI License codecov

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:
4.2.1 2022-Jun-08
4.2.0 2022-Jun-06
4.1.0 2021-Apr-27
4.1.0-rc 2021-Apr-27
4.0.5 2021-Apr-21
Show all 27 versions
Download Stats:
  • 5 downloads today

  • 17 downloads this week

  • 75 downloads this month

  • 607 downloads total

Score:
1.3
Short URL:
mocked.dub.pm