/
WorkbookRepository.go
149 lines (116 loc) · 5.03 KB
/
WorkbookRepository.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// Code generated by mockery v2.11.0. DO NOT EDIT.
package mocks
import (
context "context"
appdomain "github.com/kujilabo/cocotola/cocotola-api/src/app/domain"
domain "github.com/kujilabo/cocotola/cocotola-api/src/user/domain"
mock "github.com/stretchr/testify/mock"
service "github.com/kujilabo/cocotola/cocotola-api/src/app/service"
testing "testing"
)
// WorkbookRepository is an autogenerated mock type for the WorkbookRepository type
type WorkbookRepository struct {
mock.Mock
}
// AddWorkbook provides a mock function with given fields: ctx, operator, spaceID, param
func (_m *WorkbookRepository) AddWorkbook(ctx context.Context, operator domain.AppUserModel, spaceID domain.SpaceID, param appdomain.WorkbookAddParameter) (appdomain.WorkbookID, error) {
ret := _m.Called(ctx, operator, spaceID, param)
var r0 appdomain.WorkbookID
if rf, ok := ret.Get(0).(func(context.Context, domain.AppUserModel, domain.SpaceID, appdomain.WorkbookAddParameter) appdomain.WorkbookID); ok {
r0 = rf(ctx, operator, spaceID, param)
} else {
r0 = ret.Get(0).(appdomain.WorkbookID)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, domain.AppUserModel, domain.SpaceID, appdomain.WorkbookAddParameter) error); ok {
r1 = rf(ctx, operator, spaceID, param)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FindPersonalWorkbooks provides a mock function with given fields: ctx, operator, param
func (_m *WorkbookRepository) FindPersonalWorkbooks(ctx context.Context, operator appdomain.StudentModel, param appdomain.WorkbookSearchCondition) (appdomain.WorkbookSearchResult, error) {
ret := _m.Called(ctx, operator, param)
var r0 appdomain.WorkbookSearchResult
if rf, ok := ret.Get(0).(func(context.Context, appdomain.StudentModel, appdomain.WorkbookSearchCondition) appdomain.WorkbookSearchResult); ok {
r0 = rf(ctx, operator, param)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(appdomain.WorkbookSearchResult)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, appdomain.StudentModel, appdomain.WorkbookSearchCondition) error); ok {
r1 = rf(ctx, operator, param)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FindWorkbookByID provides a mock function with given fields: ctx, operator, id
func (_m *WorkbookRepository) FindWorkbookByID(ctx context.Context, operator appdomain.StudentModel, id appdomain.WorkbookID) (service.Workbook, error) {
ret := _m.Called(ctx, operator, id)
var r0 service.Workbook
if rf, ok := ret.Get(0).(func(context.Context, appdomain.StudentModel, appdomain.WorkbookID) service.Workbook); ok {
r0 = rf(ctx, operator, id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(service.Workbook)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, appdomain.StudentModel, appdomain.WorkbookID) error); ok {
r1 = rf(ctx, operator, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FindWorkbookByName provides a mock function with given fields: ctx, operator, spaceID, name
func (_m *WorkbookRepository) FindWorkbookByName(ctx context.Context, operator domain.AppUserModel, spaceID domain.SpaceID, name string) (service.Workbook, error) {
ret := _m.Called(ctx, operator, spaceID, name)
var r0 service.Workbook
if rf, ok := ret.Get(0).(func(context.Context, domain.AppUserModel, domain.SpaceID, string) service.Workbook); ok {
r0 = rf(ctx, operator, spaceID, name)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(service.Workbook)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, domain.AppUserModel, domain.SpaceID, string) error); ok {
r1 = rf(ctx, operator, spaceID, name)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// RemoveWorkbook provides a mock function with given fields: ctx, operator, workbookID, version
func (_m *WorkbookRepository) RemoveWorkbook(ctx context.Context, operator appdomain.StudentModel, workbookID appdomain.WorkbookID, version int) error {
ret := _m.Called(ctx, operator, workbookID, version)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, appdomain.StudentModel, appdomain.WorkbookID, int) error); ok {
r0 = rf(ctx, operator, workbookID, version)
} else {
r0 = ret.Error(0)
}
return r0
}
// UpdateWorkbook provides a mock function with given fields: ctx, operator, workbookID, version, param
func (_m *WorkbookRepository) UpdateWorkbook(ctx context.Context, operator appdomain.StudentModel, workbookID appdomain.WorkbookID, version int, param appdomain.WorkbookUpdateParameter) error {
ret := _m.Called(ctx, operator, workbookID, version, param)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, appdomain.StudentModel, appdomain.WorkbookID, int, appdomain.WorkbookUpdateParameter) error); ok {
r0 = rf(ctx, operator, workbookID, version, param)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewWorkbookRepository creates a new instance of WorkbookRepository. It also registers a cleanup function to assert the mocks expectations.
func NewWorkbookRepository(t testing.TB) *WorkbookRepository {
mock := &WorkbookRepository{}
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}