The name of expected function.
Exception message.
The file name that the assert failed in. Should be left as default.
The file line that the assert failed in. Should be left as default.
Are expected parameter values.
If function is not call with parameters, will throw an UnitTestException.
1 interface Dummy 2 { 3 void test(); 4 void test(int a); 5 } 6 7 auto mock = new Mock!Dummy; 8 mock.test(); 9 mock.test(12); 10 mock.expectCalled!"test"(); 11 mock.expectCalled!"test"(12); 12 13 // Will throw an exception like "UnitTestException@example.d(6): <test> expected call with <50> but called with <Tuple!int(12)> 14 mock.exceptCalled!"test"(50);
Used to assert function call once