mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-13 04:56:21 +01:00
52 lines
853 B
Dart
52 lines
853 B
Dart
|
import 'package:np_api/np_api.dart';
|
||
|
import 'package:test/test.dart';
|
||
|
|
||
|
void main() {
|
||
|
group("FaceParser", () {
|
||
|
test("parse", _faces);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
Future<void> _faces() async {
|
||
|
const json = """
|
||
|
{
|
||
|
"ocs": {
|
||
|
"meta": {
|
||
|
"status": "ok",
|
||
|
"statuscode": 200,
|
||
|
"message": "OK"
|
||
|
},
|
||
|
"data": [
|
||
|
{
|
||
|
"id": 1,
|
||
|
"fileId": 111
|
||
|
},
|
||
|
{
|
||
|
"id": 2,
|
||
|
"fileId": 222
|
||
|
},
|
||
|
{
|
||
|
"id": 10,
|
||
|
"fileId": 333
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
""";
|
||
|
final results = await FaceParser().parse(json);
|
||
|
expect(results, const [
|
||
|
Face(
|
||
|
id: 1,
|
||
|
fileId: 111,
|
||
|
),
|
||
|
Face(
|
||
|
id: 2,
|
||
|
fileId: 222,
|
||
|
),
|
||
|
Face(
|
||
|
id: 10,
|
||
|
fileId: 333,
|
||
|
),
|
||
|
]);
|
||
|
}
|