From 879eb071e9d5e1dacb1a8b46d9620ad74528bb47 Mon Sep 17 00:00:00 2001 From: Chri$ <2023467@stud.hs-mannheim.de> Date: Wed, 10 Jan 2024 00:12:50 +0100 Subject: [PATCH] fix analyse --- pubspec.lock | 65 +++++++----------------------- test/preferences_service_test.dart | 8 ++-- 2 files changed, 17 insertions(+), 56 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index bbffc36..f2e7bf4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -93,14 +93,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted -<<<<<<< HEAD version: "1.17.2" -======= - version: "1.18.0" ->>>>>>> bb189b31687f0d63efe9893fe4802b9d7f39782d convert: dependency: transitive description: @@ -156,11 +152,7 @@ packages: sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" url: "https://pub.dev" source: hosted -<<<<<<< HEAD - version: "7.0.0" -======= version: "6.1.4" ->>>>>>> bb189b31687f0d63efe9893fe4802b9d7f39782d fixnum: dependency: transitive description: @@ -197,14 +189,11 @@ packages: description: flutter source: sdk version: "0.0.0" -<<<<<<< HEAD -======= fuchsia_remote_debug_protocol: dependency: transitive description: flutter source: sdk version: "0.0.0" ->>>>>>> bb189b31687f0d63efe9893fe4802b9d7f39782d glob: dependency: transitive description: @@ -270,14 +259,10 @@ packages: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted -<<<<<<< HEAD version: "1.9.1" -======= - version: "1.10.0" ->>>>>>> bb189b31687f0d63efe9893fe4802b9d7f39782d mockito: dependency: "direct dev" description: @@ -330,17 +315,10 @@ packages: dependency: transitive description: name: platform -<<<<<<< HEAD - sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" url: "https://pub.dev" source: hosted - version: "3.1.4" -======= - sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 - url: "https://pub.dev" - source: hosted - version: "3.1.2" ->>>>>>> bb189b31687f0d63efe9893fe4802b9d7f39782d + version: "3.1.0" plugin_platform_interface: dependency: transitive description: @@ -348,10 +326,7 @@ packages: sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted -<<<<<<< HEAD version: "2.1.8" -======= - version: "2.1.7" process: dependency: transitive description: @@ -360,7 +335,6 @@ packages: url: "https://pub.dev" source: hosted version: "4.2.4" ->>>>>>> bb189b31687f0d63efe9893fe4802b9d7f39782d pub_semver: dependency: transitive description: @@ -450,18 +424,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.1" string_scanner: dependency: transitive description: @@ -490,14 +464,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted -<<<<<<< HEAD version: "0.6.0" -======= - version: "0.6.1" ->>>>>>> bb189b31687f0d63efe9893fe4802b9d7f39782d typed_data: dependency: transitive description: @@ -578,17 +548,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" -<<<<<<< HEAD -======= vm_service: dependency: transitive description: name: vm_service - sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 + sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f url: "https://pub.dev" source: hosted - version: "11.10.0" ->>>>>>> bb189b31687f0d63efe9893fe4802b9d7f39782d + version: "11.7.1" watcher: dependency: transitive description: @@ -601,10 +568,10 @@ packages: dependency: transitive description: name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.1.4-beta" webdriver: dependency: transitive description: @@ -628,11 +595,7 @@ packages: sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d url: "https://pub.dev" source: hosted -<<<<<<< HEAD version: "1.0.4" -======= - version: "1.0.3" ->>>>>>> bb189b31687f0d63efe9893fe4802b9d7f39782d yaml: dependency: transitive description: @@ -642,5 +605,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=3.1.5 <4.0.0" flutter: ">=3.13.0" diff --git a/test/preferences_service_test.dart b/test/preferences_service_test.dart index ef61d9e..1500709 100644 --- a/test/preferences_service_test.dart +++ b/test/preferences_service_test.dart @@ -10,16 +10,14 @@ class MockSharedPreferences extends Mock implements SharedPreferences {} void main() { group('PreferencesService Tests', () { - MockSharedPreferences mockPrefs; PreferencesService service = PreferencesService(); setUp(() { - mockPrefs = MockSharedPreferences(); SharedPreferences.setMockInitialValues({}); // Set initial values for mocks }); test('saveColorPair and loadColorPair should work correctly', () async { - var testColorPair = ColorPair(name: "test", textColor: Color(0xff123456), backgroundColor: Color(0xff654321)); + var testColorPair = ColorPair(name: "test", textColor: const Color(0xff123456), backgroundColor: const Color(0xff654321)); // Save color pair await service.saveColorPair(testColorPair); @@ -143,7 +141,7 @@ void main() { await service.saveDiaryEntry(testEntry); final DiaryEntry? retrievedEntry = await service.getDiaryEntryByCurrentDate(); - expect(retrievedEntry?.texts.join(" "), equals((testEntry?.texts.join(" ")))); + expect(retrievedEntry?.texts.join(" "), equals((testEntry.texts.join(" ")))); expect(retrievedEntry?.date, equals(formattedDate)); expect(retrievedEntry?.percentValue, testEntry.percentValue); }); @@ -162,7 +160,7 @@ void main() { await service.saveDiaryEntry(testEntry); final DiaryEntry? retrievedEntry = await service.getDiaryEntryByCurrentDate(); - expect(retrievedEntry?.texts.join(" "), equals((testEntry?.texts.join(" ")))); + expect(retrievedEntry?.texts.join(" "), equals((testEntry.texts.join(" ")))); expect(retrievedEntry?.date, equals(formattedDate)); expect(retrievedEntry?.percentValue, testEntry.percentValue); });