The name of expected function.
Count of calls.
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 many count 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", 1)(); 11 mock.expectCalled!("test", 1)(12); 12 13 // Will throw an exception like "UnitTestException@example.d(6): <test> expected call with <12> <2> count but called <1> counts 14 mock.exceptCalled!("test", 2)(12);
Used to assert function call many counts