(t *testing.T)
| 587 | } |
| 588 | |
| 589 | func TestPullRequestRepositoryDatabaseID(t *testing.T) { |
| 590 | tests := []struct { |
| 591 | name string |
| 592 | pr PullRequest |
| 593 | want int64 |
| 594 | }{ |
| 595 | { |
| 596 | name: "the repository field was requested", |
| 597 | pr: PullRequest{Repository: &PRRepository{DatabaseID: 1234}}, |
| 598 | want: 1234, |
| 599 | }, |
| 600 | { |
| 601 | name: "the repository field was not requested", |
| 602 | pr: PullRequest{}, |
| 603 | want: 0, |
| 604 | }, |
| 605 | } |
| 606 | |
| 607 | for _, tt := range tests { |
| 608 | t.Run(tt.name, func(t *testing.T) { |
| 609 | assert.Equal(t, tt.want, tt.pr.RepositoryDatabaseID()) |
| 610 | }) |
| 611 | } |
| 612 | } |
| 613 | |
| 614 | func TestPullRequestRepositoryViewerPermission(t *testing.T) { |
| 615 | tests := []struct { |
nothing calls this directly
no test coverage detected