throwStruct

A mock struct that always throws.

throwStruct
(
E = from!"unit_threaded.exception".UnitTestException
R = void
)
()

Examples

import std.exception: assertThrown;
import unit_threaded.exception: UnitTestException;
auto m = throwStruct;
assertThrown!UnitTestException(m.foo);
assertThrown!UnitTestException(m.bar(1, "foo"));

Meta