(t *testing.T)
| 612 | } |
| 613 | |
| 614 | func TestPullRequestRepositoryViewerPermission(t *testing.T) { |
| 615 | tests := []struct { |
| 616 | name string |
| 617 | pr PullRequest |
| 618 | want string |
| 619 | }{ |
| 620 | { |
| 621 | name: "the repository field was requested", |
| 622 | pr: PullRequest{Repository: &PRRepository{ViewerPermission: "WRITE"}}, |
| 623 | want: "WRITE", |
| 624 | }, |
| 625 | { |
| 626 | name: "the repository field was not requested", |
| 627 | pr: PullRequest{}, |
| 628 | want: "", |
| 629 | }, |
| 630 | } |
| 631 | |
| 632 | for _, tt := range tests { |
| 633 | t.Run(tt.name, func(t *testing.T) { |
| 634 | assert.Equal(t, tt.want, tt.pr.RepositoryViewerPermission()) |
| 635 | }) |
| 636 | } |
| 637 | } |
nothing calls this directly
no test coverage detected