Get() methods from all repositories now return a ErrNotFound when the id is nonexistent

This commit is contained in:
Deluan
2016-03-18 11:33:50 -04:00
parent db34122faf
commit c90a50827a
11 changed files with 70 additions and 42 deletions
+4 -1
View File
@@ -45,7 +45,10 @@ func (m *MockAlbum) Get(id string) (*domain.Album, error) {
if m.err {
return nil, errors.New("Error!")
}
return m.data[id], nil
if d, ok := m.data[id]; ok {
return d, nil
}
return nil, domain.ErrNotFound
}
func (m *MockAlbum) GetAll(qo domain.QueryOptions) (*domain.Albums, error) {