mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-24 05:25:19 +00:00
implemented toFactory1 method
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user