From 94cb341270ddf8cd596559f461c11bdfb5aed9ee Mon Sep 17 00:00:00 2001 From: Jonas Franz Date: Fri, 31 Jul 2020 17:27:29 +0200 Subject: [PATCH] CC --- lib/src/models/construction_report.dart | 39 ++++++++++++------------- test/construction_report_test.dart | 4 ++- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/lib/src/models/construction_report.dart b/lib/src/models/construction_report.dart index 28e070e..daca8c7 100644 --- a/lib/src/models/construction_report.dart +++ b/lib/src/models/construction_report.dart @@ -47,26 +47,25 @@ class ConstructionReport { @JsonKey(name: "bis") final DateTime endDate; - ConstructionReport({ - this.id, - this.index, - this.timePeriodTexts, - this.timePeriodPinsTexts, - this.timePeriodTimeTexts, - this.headline, - this.headlinePins, - this.messages, - this.messagesPins, - this.messagesHint, - this.hintTable, - this.reason, - this.affectedStations, - this.lastChange, - this.icsUrl, - this.timeRanges, - this.startDate, - this.endDate - }); + ConstructionReport( + {this.id, + this.index, + this.timePeriodTexts, + this.timePeriodPinsTexts, + this.timePeriodTimeTexts, + this.headline, + this.headlinePins, + this.messages, + this.messagesPins, + this.messagesHint, + this.hintTable, + this.reason, + this.affectedStations, + this.lastChange, + this.icsUrl, + this.timeRanges, + this.startDate, + this.endDate}); factory ConstructionReport.fromJson(Map json) => _$ConstructionReportFromJson(json); diff --git a/test/construction_report_test.dart b/test/construction_report_test.dart index dd03716..176039f 100644 --- a/test/construction_report_test.dart +++ b/test/construction_report_test.dart @@ -77,7 +77,9 @@ void main() { final connection = ConstructionReport.fromJson(json); expect(connection.id, "5604"); expect(connection.index, 1); - expect(connection.messages, ["Die Züge der Linien RE 4 und RE 14 enden/beginnen in Frankfurt-Höchst und fallen zwischen Frankfurt-Höchst und Frankfurt (Main) Hbf aus. Als Ersatz nutzen Sie bitte die noch verkehrenden Züge in diesem Abschnitt."]); + expect(connection.messages, [ + "Die Züge der Linien RE 4 und RE 14 enden/beginnen in Frankfurt-Höchst und fallen zwischen Frankfurt-Höchst und Frankfurt (Main) Hbf aus. Als Ersatz nutzen Sie bitte die noch verkehrenden Züge in diesem Abschnitt." + ]); expect(connection.timeRanges.length, 1); expect(connection.timeRanges[0].begin, connection.startDate); expect(connection.affectedStations.length, 2);