Change the implementation of GetAll() in preference_store.go to ret… (#10926)

* Change the implementation of GetAll() in `preference_store.go` to return an
object from `model` and a *model.AppError.
Change the Interface in `store.go` to accomodate for the change
Change the test that called the GetAll() function

* Rename the result variable to preferences so it makes more sense.
Use assertions to keep the test consistent

* Generate the correct mocks after the code changes

* Remove redundant conditions

* Address govet errors

* Resolve conflicts with master's new changes

* Fix Save() function according to the new changes in master (Got
overwritten with the previous commit)

* Change the assertions to have the same format as commit 2d97f01
Этот коммит содержится в:
Giorgos Christos Dimitriou
2019-06-03 12:25:04 +01:00
коммит произвёл Dean Whillier
родитель d1f81842a5
Коммит 2e79ae9636
5 изменённых файлов: 58 добавлений и 53 удалений

Просмотреть файл

@@ -110,19 +110,28 @@ func (_m *PreferenceStore) Get(userId string, category string, name string) (*mo
}
// GetAll provides a mock function with given fields: userId
func (_m *PreferenceStore) GetAll(userId string) store.StoreChannel {
func (_m *PreferenceStore) GetAll(userId string) (model.Preferences, *model.AppError) {
ret := _m.Called(userId)
var r0 store.StoreChannel
if rf, ok := ret.Get(0).(func(string) store.StoreChannel); ok {
var r0 model.Preferences
if rf, ok := ret.Get(0).(func(string) model.Preferences); ok {
r0 = rf(userId)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(store.StoreChannel)
r0 = ret.Get(0).(model.Preferences)
}
}
return r0
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
r1 = rf(userId)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*model.AppError)
}
}
return r0, r1
}
// GetCategory provides a mock function with given fields: userId, category