/
api_request_update_converter.go
88 lines (68 loc) · 2.91 KB
/
api_request_update_converter.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
// Code generated by mockery v2.14.0. DO NOT EDIT.
package mocks
import (
context "context"
common "github.com/NicklasWallgren/go-template/domain/common"
mock "github.com/stretchr/testify/mock"
request "github.com/NicklasWallgren/go-template/adapters/driver/api/request"
)
// APIRequestUpdateConverter is an autogenerated mock type for the APIRequestUpdateConverter type
type APIRequestUpdateConverter[T request.APIRequest, R common.EntityConstraint] struct {
mock.Mock
}
type APIRequestUpdateConverter_Expecter[T request.APIRequest, R common.EntityConstraint] struct {
mock *mock.Mock
}
func (_m *APIRequestUpdateConverter[T, R]) EXPECT() *APIRequestUpdateConverter_Expecter[T, R] {
return &APIRequestUpdateConverter_Expecter[T, R]{mock: &_m.Mock}
}
// UpdatedEntityOf provides a mock function with given fields: ctx, _a1
func (_m *APIRequestUpdateConverter[T, R]) UpdatedEntityOf(ctx context.Context, _a1 *T) (*R, error) {
ret := _m.Called(ctx, _a1)
var r0 *R
if rf, ok := ret.Get(0).(func(context.Context, *T) *R); ok {
r0 = rf(ctx, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*R)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *T) error); ok {
r1 = rf(ctx, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// APIRequestUpdateConverter_UpdatedEntityOf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatedEntityOf'
type APIRequestUpdateConverter_UpdatedEntityOf_Call[T request.APIRequest, R common.EntityConstraint] struct {
*mock.Call
}
// UpdatedEntityOf is a helper method to define mock.On call
// - ctx context.Context
// - _a1 *T
func (_e *APIRequestUpdateConverter_Expecter[T, R]) UpdatedEntityOf(ctx interface{}, _a1 interface{}) *APIRequestUpdateConverter_UpdatedEntityOf_Call[T, R] {
return &APIRequestUpdateConverter_UpdatedEntityOf_Call[T, R]{Call: _e.mock.On("UpdatedEntityOf", ctx, _a1)}
}
func (_c *APIRequestUpdateConverter_UpdatedEntityOf_Call[T, R]) Run(run func(ctx context.Context, _a1 *T)) *APIRequestUpdateConverter_UpdatedEntityOf_Call[T, R] {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*T))
})
return _c
}
func (_c *APIRequestUpdateConverter_UpdatedEntityOf_Call[T, R]) Return(_a0 *R, _a1 error) *APIRequestUpdateConverter_UpdatedEntityOf_Call[T, R] {
_c.Call.Return(_a0, _a1)
return _c
}
type mockConstructorTestingTNewAPIRequestUpdateConverter interface {
mock.TestingT
Cleanup(func())
}
// NewAPIRequestUpdateConverter creates a new instance of APIRequestUpdateConverter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewAPIRequestUpdateConverter[T request.APIRequest, R common.EntityConstraint](t mockConstructorTestingTNewAPIRequestUpdateConverter) *APIRequestUpdateConverter[T, R] {
mock := &APIRequestUpdateConverter[T, R]{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}