From ba0bdbc262b5bde71a8adf88c75167e8a20db7a7 Mon Sep 17 00:00:00 2001 From: ItsAdityaKSingh Date: Fri, 4 Feb 2022 23:58:54 +0530 Subject: [PATCH 1/3] added landmark_model_test --- pubspec.lock | 70 +++++++++++++++++++++++++++++ pubspec.yaml | 1 + test/model_tests/landmark_test.dart | 19 ++++++++ 3 files changed, 90 insertions(+) create mode 100644 test/model_tests/landmark_test.dart diff --git a/pubspec.lock b/pubspec.lock index 74c0d6a4..bb37c270 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -197,6 +197,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.0.0" + coverage: + dependency: transitive + description: + name: coverage + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" crypto: dependency: transitive description: @@ -632,6 +639,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.4.2" + node_preamble: + dependency: transitive + description: + name: node_preamble + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" normalize: dependency: transitive description: @@ -870,6 +884,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.4" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + shelf_static: + dependency: transitive + description: + name: shelf_static + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" shelf_web_socket: dependency: transitive description: @@ -917,6 +945,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + source_maps: + dependency: transitive + description: + name: source_maps + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.10" source_span: dependency: transitive description: @@ -959,6 +1001,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + test: + dependency: "direct dev" + description: + name: test + url: "https://pub.dartlang.org" + source: hosted + version: "1.17.12" test_api: dependency: transitive description: @@ -966,6 +1015,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.4.3" + test_core: + dependency: transitive + description: + name: test_core + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.2" timezone: dependency: transitive description: @@ -1085,6 +1141,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.1" + vm_service: + dependency: transitive + description: + name: vm_service + url: "https://pub.dartlang.org" + source: hosted + version: "7.5.0" watcher: dependency: transitive description: @@ -1099,6 +1162,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" win32: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index c55ce9c9..1d39e344 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -46,6 +46,7 @@ dev_dependencies: flutter_test: sdk: flutter hive_generator: ^1.1.0 + test: ^1.17.12 flutter_icons: android: "launcher_icon" diff --git a/test/model_tests/landmark_test.dart b/test/model_tests/landmark_test.dart new file mode 100644 index 00000000..6401f016 --- /dev/null +++ b/test/model_tests/landmark_test.dart @@ -0,0 +1,19 @@ +import 'package:beacon/models/landmarks/landmark.dart'; +import 'package:test/test.dart'; + +void main() { + Map dummyJson = { + "title": "landmark", + "location": {"lat": "100.1", "lon": "200.1"} + }; + + test('Checking if landmark fetch from Json is working: ', () { + Landmark landmark = Landmark.fromJson(dummyJson); + //landmark title + expect("landmark", landmark.title); + //landmark latitude + expect("100.1", landmark.location.lat); + //landmark longitude + expect("200.1", landmark.location.lon); + }); +} From 88fa80928f5bc97cd1aec911390cd33fcf82ec83 Mon Sep 17 00:00:00 2001 From: ItsAdityaKSingh Date: Sat, 5 Feb 2022 00:15:23 +0530 Subject: [PATCH 2/3] dev-dependency changes --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 1d39e344..662a662b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -46,7 +46,7 @@ dev_dependencies: flutter_test: sdk: flutter hive_generator: ^1.1.0 - test: ^1.17.12 + test: ^1.20.0 flutter_icons: android: "launcher_icon" From 8ee832263257c94cd523f0ee380030b051fa94f6 Mon Sep 17 00:00:00 2001 From: ItsAdityaKSingh Date: Sat, 5 Feb 2022 00:16:38 +0530 Subject: [PATCH 3/3] conflicts resolved --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 662a662b..f4f0f710 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -46,7 +46,7 @@ dev_dependencies: flutter_test: sdk: flutter hive_generator: ^1.1.0 - test: ^1.20.0 + test: ^1.14.4 flutter_icons: android: "launcher_icon"