(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestIssueRepositoryDatabaseID(t *testing.T) { |
| 10 | tests := []struct { |
| 11 | name string |
| 12 | issue Issue |
| 13 | want int64 |
| 14 | }{ |
| 15 | { |
| 16 | name: "the repository field was requested", |
| 17 | issue: Issue{Repository: &PRRepository{DatabaseID: 1234}}, |
| 18 | want: 1234, |
| 19 | }, |
| 20 | { |
| 21 | name: "the repository field was not requested", |
| 22 | issue: Issue{}, |
| 23 | want: 0, |
| 24 | }, |
| 25 | } |
| 26 | |
| 27 | for _, tt := range tests { |
| 28 | t.Run(tt.name, func(t *testing.T) { |
| 29 | assert.Equal(t, tt.want, tt.issue.RepositoryDatabaseID()) |
| 30 | }) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | func TestIssueRepositoryViewerPermission(t *testing.T) { |
| 35 | tests := []struct { |
nothing calls this directly
no test coverage detected