mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-23 21:13:35 +00:00
implemented toFactory method
This commit is contained in:
@@ -132,6 +132,14 @@ void main() {
|
||||
|
||||
expect(containerB.resolve<int>(), expectedIntValue);
|
||||
});
|
||||
|
||||
test("Bind to the factory resolves with value", () {
|
||||
final container = DiContainer();
|
||||
final b = B();
|
||||
container.bind<A>().toFactory(() => b);
|
||||
|
||||
expect(container.resolve<A>(), b);
|
||||
});
|
||||
}
|
||||
|
||||
ResolverMock<T> _makeResolver<T>(T expectedValue) {
|
||||
|
||||
Reference in New Issue
Block a user