(t *testing.T)
| 95 | } |
| 96 | |
| 97 | func TestIssuesService_GetEvent(t *testing.T) { |
| 98 | t.Parallel() |
| 99 | client, mux, _ := setup(t) |
| 100 | |
| 101 | mux.HandleFunc("/repos/o/r/issues/events/1", func(w http.ResponseWriter, r *http.Request) { |
| 102 | testMethod(t, r, "GET") |
| 103 | fmt.Fprint(w, `{"id":1}`) |
| 104 | }) |
| 105 | |
| 106 | ctx := t.Context() |
| 107 | event, _, err := client.Issues.GetEvent(ctx, "o", "r", 1) |
| 108 | if err != nil { |
| 109 | t.Errorf("Issues.GetEvent returned error: %v", err) |
| 110 | } |
| 111 | |
| 112 | want := &IssueEvent{ID: Ptr(int64(1))} |
| 113 | if !cmp.Equal(event, want) { |
| 114 | t.Errorf("Issues.GetEvent returned %+v, want %+v", event, want) |
| 115 | } |
| 116 | |
| 117 | const methodName = "GetEvent" |
| 118 | testBadOptions(t, methodName, func() (err error) { |
| 119 | _, _, err = client.Issues.GetEvent(ctx, "\n", "\n", -1) |
| 120 | return err |
| 121 | }) |
| 122 | |
| 123 | testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { |
| 124 | got, resp, err := client.Issues.GetEvent(ctx, "o", "r", 1) |
| 125 | if got != nil { |
| 126 | t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) |
| 127 | } |
| 128 | return resp, err |
| 129 | }) |
| 130 | } |
| 131 | |
| 132 | func TestRename_Marshal(t *testing.T) { |
| 133 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…