platform/test/util_test.dart

34 lines
655 B
Dart
Raw Normal View History

2016-04-18 03:27:23 +00:00
import 'package:angel_framework/angel_framework.dart';
import 'package:test/test.dart';
class Foo {
String name;
Foo(String this.name);
}
main() {
group('Utilities', () {
2017-05-27 12:39:45 +00:00
Angel app;
2016-04-18 03:27:23 +00:00
setUp(() {
2017-05-27 12:39:45 +00:00
app = new Angel();
2016-04-18 03:27:23 +00:00
});
2017-05-27 12:39:45 +00:00
tearDown(() async {
await app.close();
app = null;
2016-04-18 03:27:23 +00:00
});
test('can use app.properties like members', () {
2017-09-24 19:43:14 +00:00
app.configuration['hello'] = 'world';
app.configuration['foo'] = () => 'bar';
app.configuration['Foo'] = new Foo('bar');
2016-04-18 03:27:23 +00:00
2017-05-27 12:39:45 +00:00
expect(app.hello, equals('world'));
expect(app.foo(), equals('bar'));
expect(app.Foo.name, equals('bar'));
2016-04-18 03:27:23 +00:00
});
});
2016-06-19 05:02:41 +00:00
}