Add the testing gubbins
This commit is contained in:
@@ -46,3 +46,12 @@ func (m *mockNoteStore) getNoteAndIndexByID(id int) (models.Note, int, error) {
|
||||
func (m *mockNoteStore) GetAllNotes() ([]models.Note, error) {
|
||||
return m.Notes, nil
|
||||
}
|
||||
|
||||
func (m *mockNoteStore) DeleteNoteByID(id int) error {
|
||||
_, index, err := m.getNoteAndIndexByID(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
m.Notes = append(m.Notes[:index], m.Notes[index+1:]...)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user