(t *testing.T)
| 16 | ) |
| 17 | |
| 18 | func initRepository(t *testing.T) *githubRepository { |
| 19 | conf := &config.Github{ |
| 20 | URL: "https://github.example.com", |
| 21 | Token: "xxx", |
| 22 | Timeout: 1000, |
| 23 | CountCacheExpiration: 10000, |
| 24 | } |
| 25 | |
| 26 | repository := NewGithubRepository(conf) |
| 27 | |
| 28 | assert.Equal(t, "https://github.example.com/", conf.URL) |
| 29 | |
| 30 | apiGithubRepository, ok := repository.(*githubRepository) |
| 31 | if assert.True(t, ok) { |
| 32 | return apiGithubRepository |
| 33 | } |
| 34 | return nil |
| 35 | } |
| 36 | |
| 37 | func TestRepository_GetSearchCount_Error(t *testing.T) { |
| 38 | githubErr := errors.New("github error") |
no test coverage detected