nc-photos/app/test/object_extension_test.dart
2022-04-06 02:37:58 +08:00

26 lines
601 B
Dart

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);
});
});
}