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

Function TestActivityService_IsStarred_hasStar

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

Source from the content-addressed store, hash-verified

143}
144
145func TestActivityService_IsStarred_hasStar(t *testing.T) {
146 t.Parallel()
147 client, mux, _ := setup(t)
148
149 mux.HandleFunc("/user/starred/o/r", func(w http.ResponseWriter, r *http.Request) {
150 testMethod(t, r, "GET")
151 w.WriteHeader(http.StatusNoContent)
152 })
153
154 ctx := t.Context()
155 star, _, err := client.Activity.IsStarred(ctx, "o", "r")
156 if err != nil {
157 t.Errorf("Activity.IsStarred returned error: %v", err)
158 }
159 if want := true; star != want {
160 t.Errorf("Activity.IsStarred returned %+v, want %+v", star, want)
161 }
162
163 const methodName = "IsStarred"
164 testBadOptions(t, methodName, func() (err error) {
165 _, _, err = client.Activity.IsStarred(ctx, "\n", "\n")
166 return err
167 })
168
169 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
170 got, resp, err := client.Activity.IsStarred(ctx, "o", "r")
171 if got {
172 t.Errorf("testNewRequestAndDoFailure %v = %#v, want false", methodName, got)
173 }
174 return resp, err
175 })
176}
177
178func TestActivityService_IsStarred_noStar(t *testing.T) {
179 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…