QAston/DMocks-revived

@property cannot be mocked

linkrope opened this issue · 0 comments

interface Dependency
{
    @property int foo();
}

unittest
{
    auto mocker = new Mocker;
    auto dependency = mocker.mock!Dependency;
}

does not compile:

dmocks/object_mock.d(30): Error: template instance ReturnType!int does not match template declaration ReturnType(func...) if (func.length == 1 && isCallable!func)
dmocks/object_mock.d(31): Error: template instance ParameterTypeTuple!int does not match template declaration ParameterTypeTuple(func...) if (func.length == 1 && isCallable!func)
dmocks/factory.d(15): Error: template instance dmocks.object_mock.Mocked!(Dependency) error instantiating
dmocks/mocks.d(106):        instantiated from here: mock!(Dependency, )

(In the real code, I tried to mock the InputStream and the OutputStream from std.stream.)