(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestActivityService_List(t *testing.T) { |
| 16 | t.Parallel() |
| 17 | client, mux, _ := setup(t) |
| 18 | |
| 19 | mux.HandleFunc("/feeds", func(w http.ResponseWriter, r *http.Request) { |
| 20 | testMethod(t, r, "GET") |
| 21 | |
| 22 | w.WriteHeader(http.StatusOK) |
| 23 | assertWrite(t, w, feedsJSON) |
| 24 | }) |
| 25 | |
| 26 | ctx := t.Context() |
| 27 | got, _, err := client.Activity.ListFeeds(ctx) |
| 28 | if err != nil { |
| 29 | t.Errorf("Activity.ListFeeds returned error: %v", err) |
| 30 | } |
| 31 | if want := wantFeeds; !cmp.Equal(got, want) { |
| 32 | t.Errorf("Activity.ListFeeds = %+v, want %+v", got, want) |
| 33 | } |
| 34 | |
| 35 | const methodName = "ListFeeds" |
| 36 | testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { |
| 37 | got, resp, err := client.Activity.ListFeeds(ctx) |
| 38 | if got != nil { |
| 39 | t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) |
| 40 | } |
| 41 | return resp, err |
| 42 | }) |
| 43 | } |
| 44 | |
| 45 | var feedsJSON = []byte(`{ |
| 46 | "timeline_url": "https://github.com/timeline", |
nothing calls this directly
no test coverage detected
searching dependent graphs…