/
mock_EventSource.go
124 lines (101 loc) · 4.24 KB
/
mock_EventSource.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
// Code generated by mockery v2.36.0. DO NOT EDIT.
package mocker
import (
domain "github.com/ichenhe/syncthing-hook/domain"
mock "github.com/stretchr/testify/mock"
)
// MockEventSource is an autogenerated mock type for the EventSource type
type MockEventSource struct {
mock.Mock
}
type MockEventSource_Expecter struct {
mock *mock.Mock
}
func (_m *MockEventSource) EXPECT() *MockEventSource_Expecter {
return &MockEventSource_Expecter{mock: &_m.Mock}
}
// Subscribe provides a mock function with given fields: eventType, params, hookDef
func (_m *MockEventSource) Subscribe(eventType domain.EventType, params *domain.HookParameters, hookDef *domain.HookDefinition) (<-chan *domain.Event, error) {
ret := _m.Called(eventType, params, hookDef)
var r0 <-chan *domain.Event
var r1 error
if rf, ok := ret.Get(0).(func(domain.EventType, *domain.HookParameters, *domain.HookDefinition) (<-chan *domain.Event, error)); ok {
return rf(eventType, params, hookDef)
}
if rf, ok := ret.Get(0).(func(domain.EventType, *domain.HookParameters, *domain.HookDefinition) <-chan *domain.Event); ok {
r0 = rf(eventType, params, hookDef)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(<-chan *domain.Event)
}
}
if rf, ok := ret.Get(1).(func(domain.EventType, *domain.HookParameters, *domain.HookDefinition) error); ok {
r1 = rf(eventType, params, hookDef)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockEventSource_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe'
type MockEventSource_Subscribe_Call struct {
*mock.Call
}
// Subscribe is a helper method to define mock.On call
// - eventType domain.EventType
// - params *domain.HookParameters
// - hookDef *domain.HookDefinition
func (_e *MockEventSource_Expecter) Subscribe(eventType interface{}, params interface{}, hookDef interface{}) *MockEventSource_Subscribe_Call {
return &MockEventSource_Subscribe_Call{Call: _e.mock.On("Subscribe", eventType, params, hookDef)}
}
func (_c *MockEventSource_Subscribe_Call) Run(run func(eventType domain.EventType, params *domain.HookParameters, hookDef *domain.HookDefinition)) *MockEventSource_Subscribe_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(domain.EventType), args[1].(*domain.HookParameters), args[2].(*domain.HookDefinition))
})
return _c
}
func (_c *MockEventSource_Subscribe_Call) Return(_a0 <-chan *domain.Event, _a1 error) *MockEventSource_Subscribe_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockEventSource_Subscribe_Call) RunAndReturn(run func(domain.EventType, *domain.HookParameters, *domain.HookDefinition) (<-chan *domain.Event, error)) *MockEventSource_Subscribe_Call {
_c.Call.Return(run)
return _c
}
// Unsubscribe provides a mock function with given fields: eventCh
func (_m *MockEventSource) Unsubscribe(eventCh <-chan *domain.Event) {
_m.Called(eventCh)
}
// MockEventSource_Unsubscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unsubscribe'
type MockEventSource_Unsubscribe_Call struct {
*mock.Call
}
// Unsubscribe is a helper method to define mock.On call
// - eventCh <-chan *domain.Event
func (_e *MockEventSource_Expecter) Unsubscribe(eventCh interface{}) *MockEventSource_Unsubscribe_Call {
return &MockEventSource_Unsubscribe_Call{Call: _e.mock.On("Unsubscribe", eventCh)}
}
func (_c *MockEventSource_Unsubscribe_Call) Run(run func(eventCh <-chan *domain.Event)) *MockEventSource_Unsubscribe_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(<-chan *domain.Event))
})
return _c
}
func (_c *MockEventSource_Unsubscribe_Call) Return() *MockEventSource_Unsubscribe_Call {
_c.Call.Return()
return _c
}
func (_c *MockEventSource_Unsubscribe_Call) RunAndReturn(run func(<-chan *domain.Event)) *MockEventSource_Unsubscribe_Call {
_c.Call.Return(run)
return _c
}
// NewMockEventSource creates a new instance of MockEventSource. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockEventSource(t interface {
mock.TestingT
Cleanup(func())
}) *MockEventSource {
mock := &MockEventSource{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}