methodCaller should call the method with custom random generators
class TestClass { static int usedIntValue = 0; static ulong usedUlongValue = 0; @For!("value", { return 5; }) @For!("other", { return someCustomFunction(); }) void randomMethod(int value, ulong other) { usedIntValue = value; usedUlongValue = other; } } auto instance = new TestClass; methodCaller!(instance.randomMethod)(&instance.randomMethod); TestClass.usedIntValue.should.equal(5); TestClass.usedUlongValue.should.equal(6);
discoverTestCases should find the same tests like testCases
auto discovery = new TestClassDiscovery; discovery.addModule!(__FILE__, `trial.discovery.testclass`); discovery .discoverTestCases(__FILE__) .map!(a => a.toString) .join("\n") .should.equal( discovery.getTestCases .sort!((a, b) => a.location.line < b.location.line) .map!(a => a.toString) .join("\n"));