diff --git a/internal/pkg/category/datastore_mock_test.go b/internal/pkg/category/datastore_mock_test.go new file mode 100644 index 0000000..ff5d63f --- /dev/null +++ b/internal/pkg/category/datastore_mock_test.go @@ -0,0 +1,78 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: git.haefelfinger.net/piwigo/PiwigoDirectoryUploader/internal/pkg/datastore (interfaces: CategoryProvider) + +// Package category is a generated GoMock package. +package category + +import ( + datastore "git.haefelfinger.net/piwigo/PiwigoDirectoryUploader/internal/pkg/datastore" + gomock "github.com/golang/mock/gomock" + reflect "reflect" +) + +// MockCategoryProvider is a mock of CategoryProvider interface +type MockCategoryProvider struct { + ctrl *gomock.Controller + recorder *MockCategoryProviderMockRecorder +} + +// MockCategoryProviderMockRecorder is the mock recorder for MockCategoryProvider +type MockCategoryProviderMockRecorder struct { + mock *MockCategoryProvider +} + +// NewMockCategoryProvider creates a new mock instance +func NewMockCategoryProvider(ctrl *gomock.Controller) *MockCategoryProvider { + mock := &MockCategoryProvider{ctrl: ctrl} + mock.recorder = &MockCategoryProviderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockCategoryProvider) EXPECT() *MockCategoryProviderMockRecorder { + return m.recorder +} + +// GetCategoryByKey mocks base method +func (m *MockCategoryProvider) GetCategoryByKey(arg0 string) (datastore.CategoryData, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCategoryByKey", arg0) + ret0, _ := ret[0].(datastore.CategoryData) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCategoryByKey indicates an expected call of GetCategoryByKey +func (mr *MockCategoryProviderMockRecorder) GetCategoryByKey(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCategoryByKey", reflect.TypeOf((*MockCategoryProvider)(nil).GetCategoryByKey), arg0) +} + +// GetCategoryByPiwigoId mocks base method +func (m *MockCategoryProvider) GetCategoryByPiwigoId(arg0 int) (datastore.CategoryData, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCategoryByPiwigoId", arg0) + ret0, _ := ret[0].(datastore.CategoryData) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCategoryByPiwigoId indicates an expected call of GetCategoryByPiwigoId +func (mr *MockCategoryProviderMockRecorder) GetCategoryByPiwigoId(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCategoryByPiwigoId", reflect.TypeOf((*MockCategoryProvider)(nil).GetCategoryByPiwigoId), arg0) +} + +// SaveCategory mocks base method +func (m *MockCategoryProvider) SaveCategory(arg0 datastore.CategoryData) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SaveCategory", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SaveCategory indicates an expected call of SaveCategory +func (mr *MockCategoryProviderMockRecorder) SaveCategory(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveCategory", reflect.TypeOf((*MockCategoryProvider)(nil).SaveCategory), arg0) +} diff --git a/internal/pkg/category/piwigo_mock_test.go b/internal/pkg/category/piwigo_mock_test.go new file mode 100644 index 0000000..d910329 --- /dev/null +++ b/internal/pkg/category/piwigo_mock_test.go @@ -0,0 +1,211 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: git.haefelfinger.net/piwigo/PiwigoDirectoryUploader/internal/pkg/piwigo (interfaces: PiwigoApi,PiwigoCategoryApi,PiwigoImageApi) + +// Package category is a generated GoMock package. +package category + +import ( + piwigo "git.haefelfinger.net/piwigo/PiwigoDirectoryUploader/internal/pkg/piwigo" + gomock "github.com/golang/mock/gomock" + reflect "reflect" +) + +// MockPiwigoApi is a mock of PiwigoApi interface +type MockPiwigoApi struct { + ctrl *gomock.Controller + recorder *MockPiwigoApiMockRecorder +} + +// MockPiwigoApiMockRecorder is the mock recorder for MockPiwigoApi +type MockPiwigoApiMockRecorder struct { + mock *MockPiwigoApi +} + +// NewMockPiwigoApi creates a new mock instance +func NewMockPiwigoApi(ctrl *gomock.Controller) *MockPiwigoApi { + mock := &MockPiwigoApi{ctrl: ctrl} + mock.recorder = &MockPiwigoApiMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockPiwigoApi) EXPECT() *MockPiwigoApiMockRecorder { + return m.recorder +} + +// Initialize mocks base method +func (m *MockPiwigoApi) Initialize(arg0, arg1, arg2 string, arg3 int) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Initialize", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(error) + return ret0 +} + +// Initialize indicates an expected call of Initialize +func (mr *MockPiwigoApiMockRecorder) Initialize(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialize", reflect.TypeOf((*MockPiwigoApi)(nil).Initialize), arg0, arg1, arg2, arg3) +} + +// Login mocks base method +func (m *MockPiwigoApi) Login() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Login") + ret0, _ := ret[0].(error) + return ret0 +} + +// Login indicates an expected call of Login +func (mr *MockPiwigoApiMockRecorder) Login() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Login", reflect.TypeOf((*MockPiwigoApi)(nil).Login)) +} + +// Logout mocks base method +func (m *MockPiwigoApi) Logout() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Logout") + ret0, _ := ret[0].(error) + return ret0 +} + +// Logout indicates an expected call of Logout +func (mr *MockPiwigoApiMockRecorder) Logout() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Logout", reflect.TypeOf((*MockPiwigoApi)(nil).Logout)) +} + +// MockPiwigoCategoryApi is a mock of PiwigoCategoryApi interface +type MockPiwigoCategoryApi struct { + ctrl *gomock.Controller + recorder *MockPiwigoCategoryApiMockRecorder +} + +// MockPiwigoCategoryApiMockRecorder is the mock recorder for MockPiwigoCategoryApi +type MockPiwigoCategoryApiMockRecorder struct { + mock *MockPiwigoCategoryApi +} + +// NewMockPiwigoCategoryApi creates a new mock instance +func NewMockPiwigoCategoryApi(ctrl *gomock.Controller) *MockPiwigoCategoryApi { + mock := &MockPiwigoCategoryApi{ctrl: ctrl} + mock.recorder = &MockPiwigoCategoryApiMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockPiwigoCategoryApi) EXPECT() *MockPiwigoCategoryApiMockRecorder { + return m.recorder +} + +// CreateCategory mocks base method +func (m *MockPiwigoCategoryApi) CreateCategory(arg0 int, arg1 string) (int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateCategory", arg0, arg1) + ret0, _ := ret[0].(int) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateCategory indicates an expected call of CreateCategory +func (mr *MockPiwigoCategoryApiMockRecorder) CreateCategory(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCategory", reflect.TypeOf((*MockPiwigoCategoryApi)(nil).CreateCategory), arg0, arg1) +} + +// GetAllCategories mocks base method +func (m *MockPiwigoCategoryApi) GetAllCategories() (map[string]*piwigo.PiwigoCategory, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllCategories") + ret0, _ := ret[0].(map[string]*piwigo.PiwigoCategory) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAllCategories indicates an expected call of GetAllCategories +func (mr *MockPiwigoCategoryApiMockRecorder) GetAllCategories() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllCategories", reflect.TypeOf((*MockPiwigoCategoryApi)(nil).GetAllCategories)) +} + +// MockPiwigoImageApi is a mock of PiwigoImageApi interface +type MockPiwigoImageApi struct { + ctrl *gomock.Controller + recorder *MockPiwigoImageApiMockRecorder +} + +// MockPiwigoImageApiMockRecorder is the mock recorder for MockPiwigoImageApi +type MockPiwigoImageApiMockRecorder struct { + mock *MockPiwigoImageApi +} + +// NewMockPiwigoImageApi creates a new mock instance +func NewMockPiwigoImageApi(ctrl *gomock.Controller) *MockPiwigoImageApi { + mock := &MockPiwigoImageApi{ctrl: ctrl} + mock.recorder = &MockPiwigoImageApiMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockPiwigoImageApi) EXPECT() *MockPiwigoImageApiMockRecorder { + return m.recorder +} + +// DeleteImages mocks base method +func (m *MockPiwigoImageApi) DeleteImages(arg0 []int) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteImages", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteImages indicates an expected call of DeleteImages +func (mr *MockPiwigoImageApiMockRecorder) DeleteImages(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteImages", reflect.TypeOf((*MockPiwigoImageApi)(nil).DeleteImages), arg0) +} + +// ImageCheckFile mocks base method +func (m *MockPiwigoImageApi) ImageCheckFile(arg0 int, arg1 string) (int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImageCheckFile", arg0, arg1) + ret0, _ := ret[0].(int) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ImageCheckFile indicates an expected call of ImageCheckFile +func (mr *MockPiwigoImageApiMockRecorder) ImageCheckFile(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageCheckFile", reflect.TypeOf((*MockPiwigoImageApi)(nil).ImageCheckFile), arg0, arg1) +} + +// ImagesExistOnPiwigo mocks base method +func (m *MockPiwigoImageApi) ImagesExistOnPiwigo(arg0 []string) (map[string]int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ImagesExistOnPiwigo", arg0) + ret0, _ := ret[0].(map[string]int) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ImagesExistOnPiwigo indicates an expected call of ImagesExistOnPiwigo +func (mr *MockPiwigoImageApiMockRecorder) ImagesExistOnPiwigo(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImagesExistOnPiwigo", reflect.TypeOf((*MockPiwigoImageApi)(nil).ImagesExistOnPiwigo), arg0) +} + +// UploadImage mocks base method +func (m *MockPiwigoImageApi) UploadImage(arg0 int, arg1, arg2 string, arg3 int) (int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UploadImage", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(int) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UploadImage indicates an expected call of UploadImage +func (mr *MockPiwigoImageApiMockRecorder) UploadImage(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UploadImage", reflect.TypeOf((*MockPiwigoImageApi)(nil).UploadImage), arg0, arg1, arg2, arg3) +}