Introduced types for the collections

This commit is contained in:
Deluan
2016-03-03 21:01:55 -05:00
parent eae9f3168f
commit fc6d49d34c
11 changed files with 29 additions and 21 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ func CreateMockArtistIndexRepo() *MockArtistIndex {
type MockArtistIndex struct {
domain.ArtistIndexRepository
data []domain.ArtistIndex
data domain.ArtistIndexes
err bool
}
@@ -22,14 +22,14 @@ func (m *MockArtistIndex) SetError(err bool) {
}
func (m *MockArtistIndex) SetData(j string, length int) {
m.data = make([]domain.ArtistIndex, length)
m.data = make(domain.ArtistIndexes, length)
err := json.Unmarshal([]byte(j), &m.data)
if err != nil {
fmt.Println("ERROR: ", err)
}
}
func (m *MockArtistIndex) GetAll() ([]domain.ArtistIndex, error) {
func (m *MockArtistIndex) GetAll() (domain.ArtistIndexes, error) {
if m.err {
return nil, errors.New("Error!")
}