(t *testing.T)
| 197 | } |
| 198 | |
| 199 | func TestClientPushWithContext(t *testing.T) { |
| 200 | n := mockNotification() |
| 201 | var apnsID = "02ABC856-EF8D-4E49-8F15-7B8A61D978D6" |
| 202 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 203 | w.Header().Set("Content-Type", "application/json; charset=utf-8") |
| 204 | w.Header().Set("apns-id", apnsID) |
| 205 | w.WriteHeader(http.StatusOK) |
| 206 | })) |
| 207 | defer server.Close() |
| 208 | |
| 209 | res, err := mockClient(server.URL).PushWithContext(context.Background(), n) |
| 210 | assert.Nil(t, err) |
| 211 | assert.Equal(t, res.ApnsID, apnsID) |
| 212 | } |
| 213 | |
| 214 | func TestClientPushWithNilContext(t *testing.T) { |
| 215 | n := mockNotification() |
nothing calls this directly
no test coverage detected