diff --git a/test/poodinis/autowiretest.d b/test/poodinis/autowiretest.d index bb7bc80..42aca4d 100644 --- a/test/poodinis/autowiretest.d +++ b/test/poodinis/autowiretest.d @@ -28,6 +28,13 @@ version(unittest) { } } + class DummyAttribute{}; + + class ComponentE { + @DummyAttribute + public ComponentC componentC; + } + // Test autowiring concrete type to existing instance unittest { auto container = new Container(); @@ -64,4 +71,12 @@ version(unittest) { ComponentD componentD = new ComponentD(); assertThrown!(ResolveException)(container.autowire!(ComponentD)(componentD), "Autowiring unregistered type should throw ResolveException"); } + + // Test autowiring member with non-autowire attribute does not autowire + unittest { + auto container = new Container(); + ComponentE componentE = new ComponentE(); + container.autowire!ComponentE(componentE); + assert(componentE.componentC is null, "Autowiring should not occur for members with attributes other than @Autowire"); + } } \ No newline at end of file