diff --git a/source/poodinis/container.d b/source/poodinis/container.d index a224166..644415b 100644 --- a/source/poodinis/container.d +++ b/source/poodinis/container.d @@ -98,8 +98,8 @@ synchronized class DependencyContainer { * * See_Also: singleInstance, newInstance, existingInstance */ - public Registration register(ConcreteType)() { - return register!(ConcreteType, ConcreteType)([]); + public Registration register(ConcreteType)(RegistrationOption[] options = []) { + return register!(ConcreteType, ConcreteType)(options); } /** diff --git a/test/poodinis/containertest.d b/test/poodinis/containertest.d index 9f12203..9f4cbbc 100644 --- a/test/poodinis/containertest.d +++ b/test/poodinis/containertest.d @@ -511,6 +511,14 @@ version(unittest) { auto firstInstance = container.resolve!TestInterface; assertThrown!ResolveException(container.resolve!TestClass); } + + // Test registering conrete type with registration option doNotAddConcreteTypeRegistration does nothing + unittest { + shared(DependencyContainer) container = new DependencyContainer(); + container.register!TestClass([RegistrationOption.doNotAddConcreteTypeRegistration]); + container.resolve!TestClass; + } + // Test registering type with options in the DEPRECATED way unittest { shared(DependencyContainer) container = new DependencyContainer();