MCPcopy Create free account
hub / github.com/google/go-github / TestActivityService_IsStarred_noStar

Function TestActivityService_IsStarred_noStar

github/activity_star_test.go:178–209  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

176}
177
178func TestActivityService_IsStarred_noStar(t *testing.T) {
179 t.Parallel()
180 client, mux, _ := setup(t)
181
182 mux.HandleFunc("/user/starred/o/r", func(w http.ResponseWriter, r *http.Request) {
183 testMethod(t, r, "GET")
184 w.WriteHeader(http.StatusNotFound)
185 })
186
187 ctx := t.Context()
188 star, _, err := client.Activity.IsStarred(ctx, "o", "r")
189 if err != nil {
190 t.Errorf("Activity.IsStarred returned error: %v", err)
191 }
192 if want := false; star != want {
193 t.Errorf("Activity.IsStarred returned %+v, want %+v", star, want)
194 }
195
196 const methodName = "IsStarred"
197 testBadOptions(t, methodName, func() (err error) {
198 _, _, err = client.Activity.IsStarred(ctx, "\n", "\n")
199 return err
200 })
201
202 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
203 got, resp, err := client.Activity.IsStarred(ctx, "o", "r")
204 if got {
205 t.Errorf("testNewRequestAndDoFailure %v = %#v, want false", methodName, got)
206 }
207 return resp, err
208 })
209}
210
211func TestActivityService_IsStarred_invalidID(t *testing.T) {
212 t.Parallel()

Callers

nothing calls this directly

Calls 5

testMethodFunction · 0.85
testBadOptionsFunction · 0.85
setupFunction · 0.70
IsStarredMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…