Add test for registering class with single instance scope

This commit is contained in:
Mike Bierlee 2014-05-20 23:07:42 +02:00
parent 2bced68e43
commit aed449e565

View file

@ -94,4 +94,13 @@ version(unittest) {
}
}
// Test resolve single instance for type
unittest {
auto container = new Container();
container.register!(TestClass)().singleInstance();
auto instance1 = container.resolve!(TestClass);
auto instance2 = container.resolve!(TestClass);
assert(instance1 is instance2);
}
}