Skip to content

Commit 4b923bc

Browse files
committed
analysis fixes (tests)
1 parent c109683 commit 4b923bc

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

test/c2logbook_test.dart

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ void main() {
6767
"ranked": false,
6868
"comments": null
6969
}""");
70-
expect(C2Results.fromJson(jsonData), testResultsMin);
70+
expect(
71+
C2Results.fromJson(jsonData as Map<String, dynamic>), testResultsMin);
7172
});
7273

7374
test('Test Parsing maximal Result JSON', () {
@@ -91,7 +92,8 @@ void main() {
9192
"comments": null,
9293
"privacy": "partners"
9394
}""");
94-
expect(C2Results.fromJson(jsonData), testResultsMax);
95+
expect(
96+
C2Results.fromJson(jsonData as Map<String, dynamic>), testResultsMax);
9597
});
9698

9799
test('Test Parsing Result JSON from Concept2 example', () {
@@ -115,7 +117,7 @@ void main() {
115117
"privacy": "partners"
116118
}""");
117119
expect(
118-
C2Results.fromJson(jsonData),
120+
C2Results.fromJson(jsonData as Map<String, dynamic>),
119121
C2Results(
120122
id: 3,
121123
userId: 1,
@@ -153,7 +155,7 @@ void main() {
153155
"logbook_privacy": "partners"
154156
}""");
155157

156-
expect(C2User.fromJson(jsonData), testUser);
158+
expect(C2User.fromJson(jsonData as Map<String, dynamic>), testUser);
157159
});
158160

159161
test("Test parsing webhook JSON (minimal)", () {
@@ -179,7 +181,8 @@ void main() {
179181
}
180182
}
181183
}""");
182-
expect(C2Webhook.parse(webhookJson), testResultsMin);
184+
expect(C2Response.parseWebhook(webhookJson as Map<String, dynamic>),
185+
testResultsMin);
183186
});
184187

185188
test("Test parsing Result JSON (with intervals workout and Heart rate)",
@@ -252,8 +255,8 @@ void main() {
252255
"real_time": null
253256
}""");
254257
expect(
255-
C2Results.fromJson(webhookJson),
256-
C2Results(
258+
C2FullResults.fromJson(webhookJson as Map<String, dynamic>),
259+
C2FullResults(
257260
id: 87654321,
258261
userId: 1234567,
259262
endDate: DateTime.parse("2024-04-22 17:41:00"),

0 commit comments

Comments
 (0)