File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ import 'dart:convert' ;
2
+
3
+ import 'package:github/src/common/model/checks.dart' ;
4
+ import 'package:test/test.dart' ;
5
+
6
+ void main () {
7
+ group ('Check run' , () {
8
+ test ('CheckRun fromJson' , () {
9
+ // This is a truncated version of the response
10
+ const checkRunJson = '''{
11
+ "id": 4,
12
+ "head_sha": "ce587453ced02b1526dfb4cb910479d431683101",
13
+ "external_id": "",
14
+ "details_url": "https://example.com",
15
+ "status": "completed",
16
+ "conclusion": "neutral",
17
+ "started_at": "2018-05-04T01:14:52Z",
18
+ "name": "mighty_readme",
19
+ "check_suite": {
20
+ "id": 5
21
+ }
22
+ }''' ;
23
+ final checkRun = CheckRun .fromJson (jsonDecode (checkRunJson));
24
+
25
+ expect (checkRun.id, 4 );
26
+ expect (checkRun.name, 'mighty_readme' );
27
+ expect (checkRun.conclusion, CheckRunConclusion .neutral);
28
+ });
29
+ });
30
+ }
You can’t perform that action at this time.
0 commit comments