1
0
mirror of https://github.com/nisrulz/flutter-examples.git synced 2025-11-08 20:50:04 +00:00

Example for Unit Test (#52)

This commit is contained in:
Miten Gajjar
2020-07-06 00:12:20 +05:30
committed by GitHub
parent 07b7411e54
commit 389623e159
75 changed files with 1723 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:unit_testing/helpers.dart';
import 'package:unit_testing/model/location.dart';
void main() {
test(
"fetched places",
() async {
print("test is running");
print("called API for feching Locations");
final places = await TouristPlaces.getData();
expect(places.length, greaterThan(0));
for (var i in places) {
final Location place = i;
expect(place.id, isNotNull);
}
},
);
}