(t *testing.T)
| 63 | } |
| 64 | |
| 65 | func TestProjectsService_GetOrganizationProject(t *testing.T) { |
| 66 | t.Parallel() |
| 67 | client, mux, _ := setup(t) |
| 68 | |
| 69 | mux.HandleFunc("/orgs/o/projectsV2/1", func(w http.ResponseWriter, r *http.Request) { |
| 70 | testMethod(t, r, "GET") |
| 71 | fmt.Fprint(w, `{"id":1,"title":"OrgProj","created_at":"2011-01-02T15:04:05Z","updated_at":"2012-01-02T15:04:05Z"}`) |
| 72 | }) |
| 73 | |
| 74 | ctx := t.Context() |
| 75 | project, _, err := client.Projects.GetOrganizationProject(ctx, "o", 1) |
| 76 | if err != nil { |
| 77 | t.Fatalf("Projects.GetOrganizationProject returned error: %v", err) |
| 78 | } |
| 79 | if project.GetID() != 1 || project.GetTitle() != "OrgProj" { |
| 80 | t.Fatalf("Projects.GetOrganizationProject returned %+v", project) |
| 81 | } |
| 82 | |
| 83 | const methodName = "GetOrganizationProject" |
| 84 | testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { |
| 85 | got, resp, err := client.Projects.GetOrganizationProject(ctx, "o", 1) |
| 86 | if got != nil { |
| 87 | t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) |
| 88 | } |
| 89 | return resp, err |
| 90 | }) |
| 91 | } |
| 92 | |
| 93 | func TestProjectsService_ListUserProjects(t *testing.T) { |
| 94 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…