mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Add test for registering class with single instance scope
This commit is contained in:
parent
2bced68e43
commit
aed449e565
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue