Test deprecated options-by-array overload

This commit is contained in:
Mike Bierlee 2016-06-27 20:40:08 +02:00
parent 2278378080
commit e800a9029e

View file

@ -503,6 +503,15 @@ version(unittest) {
assertThrown!ResolveException(container.resolve!TestClass); 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) // Test registering type with option DO_NOT_ADD_CONCRETE_TYPE_REGISTRATION (DEPRECATED)
unittest { unittest {
shared(DependencyContainer) container = new DependencyContainer(); shared(DependencyContainer) container = new DependencyContainer();