diff --git a/test/poodinis/autowiretest.d b/test/poodinis/autowiretest.d index f0cea0f..bb7bc80 100644 --- a/test/poodinis/autowiretest.d +++ b/test/poodinis/autowiretest.d @@ -1,5 +1,7 @@ import poodinis.autowire; +import std.exception; + version(unittest) { class ComponentA { } @@ -55,4 +57,11 @@ version(unittest) { auto actualComponent = componentD.componentC; assert(expectedComponent is actualComponent, "Autowiring the second time wired a different instance"); } + + // Test autowiring unregistered type + unittest { + auto container = new Container(); + ComponentD componentD = new ComponentD(); + assertThrown!(ResolveException)(container.autowire!(ComponentD)(componentD), "Autowiring unregistered type should throw ResolveException"); + } } \ No newline at end of file