2021-05-14 07:41:25 +00:00
|
|
|
import 'package:angel3_container/angel3_container.dart';
|
2018-10-22 15:45:11 +00:00
|
|
|
import 'package:test/test.dart';
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
test('returns the same instance', () {
|
2019-10-12 13:34:15 +00:00
|
|
|
var container = Container(const EmptyReflector())
|
|
|
|
..registerLazySingleton<Dummy>((_) => Dummy('a'));
|
2018-10-22 15:45:11 +00:00
|
|
|
|
|
|
|
var first = container.make<Dummy>();
|
|
|
|
expect(container.make<Dummy>(), first);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
class Dummy {
|
|
|
|
final String s;
|
|
|
|
|
|
|
|
Dummy(this.s);
|
|
|
|
}
|