Make sure mock implementations implements their full interface

This commit is contained in:
Deluan 2020-01-11 21:52:39 -05:00
parent cb107f77f8
commit dd5945ad86
4 changed files with 12 additions and 2 deletions

View File

@ -51,8 +51,10 @@ func (m *MockAlbum) Get(id string) (*domain.Album, error) {
return nil, domain.ErrNotFound
}
func (m *MockAlbum) GetAll(qo domain.QueryOptions) (domain.Albums, error) {
m.Options = qo
func (m *MockAlbum) GetAll(qo ...domain.QueryOptions) (domain.Albums, error) {
if len(qo) > 0 {
m.Options = qo[0]
}
if m.err {
return nil, errors.New("Error!")
}
@ -74,3 +76,5 @@ func (m *MockAlbum) FindByArtist(artistId string) (domain.Albums, error) {
return res, nil
}
var _ domain.AlbumRepository = (*MockAlbum)(nil)

View File

@ -48,3 +48,5 @@ func (m *MockArtist) Get(id string) (*domain.Artist, error) {
}
return nil, domain.ErrNotFound
}
var _ domain.ArtistRepository = (*MockArtist)(nil)

View File

@ -36,3 +36,5 @@ func (m *MockArtistIndex) GetAll() (domain.ArtistIndexes, error) {
}
return m.data, nil
}
var _ domain.ArtistIndexRepository = (*MockArtistIndex)(nil)

View File

@ -67,3 +67,5 @@ func (m *MockMediaFile) FindByAlbum(artistId string) (domain.MediaFiles, error)
return res, nil
}
var _ domain.MediaFileRepository = (*MockMediaFile)(nil)