Skip to content

Commit

Permalink
Resource Tested for JSON marshalling : CheckSuitePreferenceResults
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar23sj committed Jul 6, 2021
1 parent a9cb8e5 commit f2260a0
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions github/checks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1675,3 +1675,41 @@ func TestPreferenceList_Marshal(t *testing.T) {

testJSONMarshal(t, u, want)
}

func TestCheckSuitePreferenceResults_Marshal(t *testing.T) {
testJSONMarshal(t, &CheckSuitePreferenceResults{}, "{}")

u := &CheckSuitePreferenceResults{
Preferences: &PreferenceList{
AutoTriggerChecks: []*AutoTriggerCheck{
{
AppID: Int64(1),
Setting: Bool(false),
},
},
},
Repository: &Repository{
ID: Int64(1),
URL: String("u"),
Name: String("n"),
},
}

want := `{
"preferences": {
"auto_trigger_checks": [
{
"app_id": 1,
"setting": false
}
]
},
"repository": {
"id":1,
"name":"n",
"url":"u"
}
}`

testJSONMarshal(t, u, want)
}

0 comments on commit f2260a0

Please sign in to comment.