-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathmock_interfaceGetter.go
144 lines (117 loc) · 4.02 KB
/
mock_interfaceGetter.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
// Code generated by mockery v2.36.0. DO NOT EDIT.
package gateway
import (
net "net"
mock "github.com/stretchr/testify/mock"
)
// mockinterfaceGetter is an autogenerated mock type for the interfaceGetter type
type mockinterfaceGetter struct {
mock.Mock
}
type mockinterfaceGetter_Expecter struct {
mock *mock.Mock
}
func (_m *mockinterfaceGetter) EXPECT() *mockinterfaceGetter_Expecter {
return &mockinterfaceGetter_Expecter{mock: &_m.Mock}
}
// Addrs provides a mock function with given fields: iface
func (_m *mockinterfaceGetter) Addrs(iface *net.Interface) ([]net.Addr, error) {
ret := _m.Called(iface)
var r0 []net.Addr
var r1 error
if rf, ok := ret.Get(0).(func(*net.Interface) ([]net.Addr, error)); ok {
return rf(iface)
}
if rf, ok := ret.Get(0).(func(*net.Interface) []net.Addr); ok {
r0 = rf(iface)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]net.Addr)
}
}
if rf, ok := ret.Get(1).(func(*net.Interface) error); ok {
r1 = rf(iface)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockinterfaceGetter_Addrs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Addrs'
type mockinterfaceGetter_Addrs_Call struct {
*mock.Call
}
// Addrs is a helper method to define mock.On call
// - iface *net.Interface
func (_e *mockinterfaceGetter_Expecter) Addrs(iface interface{}) *mockinterfaceGetter_Addrs_Call {
return &mockinterfaceGetter_Addrs_Call{Call: _e.mock.On("Addrs", iface)}
}
func (_c *mockinterfaceGetter_Addrs_Call) Run(run func(iface *net.Interface)) *mockinterfaceGetter_Addrs_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*net.Interface))
})
return _c
}
func (_c *mockinterfaceGetter_Addrs_Call) Return(_a0 []net.Addr, _a1 error) *mockinterfaceGetter_Addrs_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *mockinterfaceGetter_Addrs_Call) RunAndReturn(run func(*net.Interface) ([]net.Addr, error)) *mockinterfaceGetter_Addrs_Call {
_c.Call.Return(run)
return _c
}
// InterfaceByName provides a mock function with given fields: name
func (_m *mockinterfaceGetter) InterfaceByName(name string) (*net.Interface, error) {
ret := _m.Called(name)
var r0 *net.Interface
var r1 error
if rf, ok := ret.Get(0).(func(string) (*net.Interface, error)); ok {
return rf(name)
}
if rf, ok := ret.Get(0).(func(string) *net.Interface); ok {
r0 = rf(name)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*net.Interface)
}
}
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(name)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockinterfaceGetter_InterfaceByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InterfaceByName'
type mockinterfaceGetter_InterfaceByName_Call struct {
*mock.Call
}
// InterfaceByName is a helper method to define mock.On call
// - name string
func (_e *mockinterfaceGetter_Expecter) InterfaceByName(name interface{}) *mockinterfaceGetter_InterfaceByName_Call {
return &mockinterfaceGetter_InterfaceByName_Call{Call: _e.mock.On("InterfaceByName", name)}
}
func (_c *mockinterfaceGetter_InterfaceByName_Call) Run(run func(name string)) *mockinterfaceGetter_InterfaceByName_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string))
})
return _c
}
func (_c *mockinterfaceGetter_InterfaceByName_Call) Return(_a0 *net.Interface, _a1 error) *mockinterfaceGetter_InterfaceByName_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *mockinterfaceGetter_InterfaceByName_Call) RunAndReturn(run func(string) (*net.Interface, error)) *mockinterfaceGetter_InterfaceByName_Call {
_c.Call.Return(run)
return _c
}
// newMockinterfaceGetter creates a new instance of mockinterfaceGetter. 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 newMockinterfaceGetter(t interface {
mock.TestingT
Cleanup(func())
}) *mockinterfaceGetter {
mock := &mockinterfaceGetter{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}