-
Notifications
You must be signed in to change notification settings - Fork 13
/
permission_role_repository_mock.go
57 lines (40 loc) · 1.11 KB
/
permission_role_repository_mock.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
package mongo_repositories
import (
"context"
"github.com/febrihidayan/go-architecture-monorepo/services/auth/domain/entities"
"github.com/stretchr/testify/mock"
)
type PermissionRoleRepositoryMock struct {
mock.Mock
}
func (x *PermissionRoleRepositoryMock) CreateMany(ctx context.Context, payload []*entities.PermissionRole) (err error) {
args := x.Called(payload)
if n, ok := args.Get(0).(error); ok {
err = n
}
return
}
func (x *PermissionRoleRepositoryMock) AllByRoleId(ctx context.Context, roleId string) (result []*entities.PermissionRole, err error) {
args := x.Called(roleId)
if n, ok := args.Get(0).([]*entities.PermissionRole); ok {
result = n
}
if n, ok := args.Get(1).(error); ok {
err = n
}
return
}
func (x *PermissionRoleRepositoryMock) DeleteByPermissionIds(ctx context.Context, ids []string) (err error) {
args := x.Called(ids)
if n, ok := args.Get(0).(error); ok {
err = n
}
return
}
func (x *PermissionRoleRepositoryMock) DeleteByRoleId(ctx context.Context, roleId string) (err error) {
args := x.Called(roleId)
if n, ok := args.Get(0).(error); ok {
err = n
}
return
}