From e800a9029e7f2d95e88b98222f0722f39f02afd6 Mon Sep 17 00:00:00 2001 From: Mike Bierlee Date: Mon, 27 Jun 2016 20:40:08 +0200 Subject: [PATCH] Test deprecated options-by-array overload --- test/poodinis/containertest.d | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/poodinis/containertest.d b/test/poodinis/containertest.d index de12384..824d54f 100644 --- a/test/poodinis/containertest.d +++ b/test/poodinis/containertest.d @@ -503,6 +503,15 @@ version(unittest) { assertThrown!ResolveException(container.resolve!TestClass); } + // Test registering type with option doNotAddConcreteTypeRegistration as array (DEPRECATED) + unittest { + shared(DependencyContainer) container = new DependencyContainer(); + container.register!(TestInterface, TestClass)([RegistrationOption.doNotAddConcreteTypeRegistration]); + + auto firstInstance = container.resolve!TestInterface; + assertThrown!ResolveException(container.resolve!TestClass); + } + // Test registering type with option DO_NOT_ADD_CONCRETE_TYPE_REGISTRATION (DEPRECATED) unittest { shared(DependencyContainer) container = new DependencyContainer();