(t *testing.T)
| 275 | } |
| 276 | |
| 277 | func TestUsersService_IsFollowing_error(t *testing.T) { |
| 278 | t.Parallel() |
| 279 | client, mux, _ := setup(t) |
| 280 | |
| 281 | mux.HandleFunc("/users/u/following/t", func(w http.ResponseWriter, r *http.Request) { |
| 282 | testMethod(t, r, "GET") |
| 283 | http.Error(w, "BadRequest", http.StatusBadRequest) |
| 284 | }) |
| 285 | |
| 286 | ctx := t.Context() |
| 287 | following, _, err := client.Users.IsFollowing(ctx, "u", "t") |
| 288 | if err == nil { |
| 289 | t.Error("Expected HTTP 400 response") |
| 290 | } |
| 291 | if want := false; following != want { |
| 292 | t.Errorf("Users.IsFollowing returned %+v, want %+v", following, want) |
| 293 | } |
| 294 | |
| 295 | const methodName = "IsFollowing" |
| 296 | testBadOptions(t, methodName, func() (err error) { |
| 297 | _, _, err = client.Users.IsFollowing(ctx, "u", "t") |
| 298 | return err |
| 299 | }) |
| 300 | |
| 301 | testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { |
| 302 | got, resp, err := client.Users.IsFollowing(ctx, "u", "t") |
| 303 | if got { |
| 304 | t.Errorf("testNewRequestAndDoFailure %v = %#v, want false", methodName, got) |
| 305 | } |
| 306 | return resp, err |
| 307 | }) |
| 308 | } |
| 309 | |
| 310 | func TestUsersService_IsFollowing_invalidUser(t *testing.T) { |
| 311 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…