implemented toFactory1 method

This commit is contained in:
Sergey Penkovsky
2020-07-03 08:43:20 +03:00
parent 6616c4d6e7
commit 456076ffa2
2 changed files with 12 additions and 2 deletions

View File

@@ -140,6 +140,15 @@ void main() {
expect(container.resolve<A>(), b);
});
test("Bind to the factory resolves with value", () {
final container = DiContainer();
final b = B();
container.bind<A>().toValue(b);
container.bind<DependOnA>().toFactory1<A>((a) => DependOnA(a));
expect(container.resolve<DependOnA>().a, b);
});
}
ResolverMock<T> _makeResolver<T>(T expectedValue) {