(t *testing.T)
| 823 | } |
| 824 | |
| 825 | func TestGistsService_IsStarred_hasStar(t *testing.T) { |
| 826 | t.Parallel() |
| 827 | client, mux, _ := setup(t) |
| 828 | |
| 829 | mux.HandleFunc("/gists/1/star", func(w http.ResponseWriter, r *http.Request) { |
| 830 | testMethod(t, r, "GET") |
| 831 | w.WriteHeader(http.StatusNoContent) |
| 832 | }) |
| 833 | |
| 834 | ctx := t.Context() |
| 835 | star, _, err := client.Gists.IsStarred(ctx, "1") |
| 836 | if err != nil { |
| 837 | t.Errorf("Gists.Starred returned error: %v", err) |
| 838 | } |
| 839 | if want := true; star != want { |
| 840 | t.Errorf("Gists.Starred returned %+v, want %+v", star, want) |
| 841 | } |
| 842 | |
| 843 | const methodName = "IsStarred" |
| 844 | testBadOptions(t, methodName, func() (err error) { |
| 845 | _, _, err = client.Gists.IsStarred(ctx, "\n") |
| 846 | return err |
| 847 | }) |
| 848 | |
| 849 | testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { |
| 850 | got, resp, err := client.Gists.IsStarred(ctx, "1") |
| 851 | if got { |
| 852 | t.Errorf("testNewRequestAndDoFailure %v = %#v, want false", methodName, got) |
| 853 | } |
| 854 | return resp, err |
| 855 | }) |
| 856 | } |
| 857 | |
| 858 | func TestGistsService_IsStarred_noStar(t *testing.T) { |
| 859 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…