CC

master
Jonas Franz 4 years ago
parent 2db94afe4d
commit 94cb341270
Signed by: JonasFranzDEV
GPG Key ID: 7293A220B7C38080
  1. 39
      lib/src/models/construction_report.dart
  2. 4
      test/construction_report_test.dart

@ -47,26 +47,25 @@ class ConstructionReport {
@JsonKey(name: "bis") @JsonKey(name: "bis")
final DateTime endDate; final DateTime endDate;
ConstructionReport({ ConstructionReport(
this.id, {this.id,
this.index, this.index,
this.timePeriodTexts, this.timePeriodTexts,
this.timePeriodPinsTexts, this.timePeriodPinsTexts,
this.timePeriodTimeTexts, this.timePeriodTimeTexts,
this.headline, this.headline,
this.headlinePins, this.headlinePins,
this.messages, this.messages,
this.messagesPins, this.messagesPins,
this.messagesHint, this.messagesHint,
this.hintTable, this.hintTable,
this.reason, this.reason,
this.affectedStations, this.affectedStations,
this.lastChange, this.lastChange,
this.icsUrl, this.icsUrl,
this.timeRanges, this.timeRanges,
this.startDate, this.startDate,
this.endDate this.endDate});
});
factory ConstructionReport.fromJson(Map<String, dynamic> json) => factory ConstructionReport.fromJson(Map<String, dynamic> json) =>
_$ConstructionReportFromJson(json); _$ConstructionReportFromJson(json);

@ -77,7 +77,9 @@ void main() {
final connection = ConstructionReport.fromJson(json); final connection = ConstructionReport.fromJson(json);
expect(connection.id, "5604"); expect(connection.id, "5604");
expect(connection.index, 1); 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.length, 1);
expect(connection.timeRanges[0].begin, connection.startDate); expect(connection.timeRanges[0].begin, connection.startDate);
expect(connection.affectedStations.length, 2); expect(connection.affectedStations.length, 2);

Loading…
Cancel
Save