nc-photos/app/test/object_extension_test.dart

27 lines
601 B
Dart
Raw Normal View History

2021-12-19 19:28:10 +01:00
import 'package:nc_photos/object_extension.dart';
import 'package:test/test.dart';
void main() {
group("ObjectExtension", () {
test("apply", () {
const obj = Object();
expect(obj.apply((obj) => 1), obj);
});
test("applyFuture", () async {
const obj = Object();
expect(await obj.applyFuture((obj) async => 1), obj);
});
test("run", () {
const obj = Object();
expect(obj.run((obj) => 1), 1);
});
test("runFuture", () async {
const obj = Object();
expect(await obj.runFuture((obj) => Future.value(1)), 1);
});
2021-12-19 19:28:10 +01:00
});
}