hysteria/extras/outbounds/mock_PluggableOutbound.go

152 lines
3.9 KiB
Go

// Code generated by mockery v2.43.0. DO NOT EDIT.
package outbounds
import (
net "net"
mock "github.com/stretchr/testify/mock"
)
// mockPluggableOutbound is an autogenerated mock type for the PluggableOutbound type
type mockPluggableOutbound struct {
mock.Mock
}
type mockPluggableOutbound_Expecter struct {
mock *mock.Mock
}
func (_m *mockPluggableOutbound) EXPECT() *mockPluggableOutbound_Expecter {
return &mockPluggableOutbound_Expecter{mock: &_m.Mock}
}
// TCP provides a mock function with given fields: reqAddr
func (_m *mockPluggableOutbound) TCP(reqAddr *AddrEx) (net.Conn, error) {
ret := _m.Called(reqAddr)
if len(ret) == 0 {
panic("no return value specified for TCP")
}
var r0 net.Conn
var r1 error
if rf, ok := ret.Get(0).(func(*AddrEx) (net.Conn, error)); ok {
return rf(reqAddr)
}
if rf, ok := ret.Get(0).(func(*AddrEx) net.Conn); ok {
r0 = rf(reqAddr)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(net.Conn)
}
}
if rf, ok := ret.Get(1).(func(*AddrEx) error); ok {
r1 = rf(reqAddr)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockPluggableOutbound_TCP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TCP'
type mockPluggableOutbound_TCP_Call struct {
*mock.Call
}
// TCP is a helper method to define mock.On call
// - reqAddr *AddrEx
func (_e *mockPluggableOutbound_Expecter) TCP(reqAddr interface{}) *mockPluggableOutbound_TCP_Call {
return &mockPluggableOutbound_TCP_Call{Call: _e.mock.On("TCP", reqAddr)}
}
func (_c *mockPluggableOutbound_TCP_Call) Run(run func(reqAddr *AddrEx)) *mockPluggableOutbound_TCP_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*AddrEx))
})
return _c
}
func (_c *mockPluggableOutbound_TCP_Call) Return(_a0 net.Conn, _a1 error) *mockPluggableOutbound_TCP_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *mockPluggableOutbound_TCP_Call) RunAndReturn(run func(*AddrEx) (net.Conn, error)) *mockPluggableOutbound_TCP_Call {
_c.Call.Return(run)
return _c
}
// UDP provides a mock function with given fields: reqAddr
func (_m *mockPluggableOutbound) UDP(reqAddr *AddrEx) (UDPConn, error) {
ret := _m.Called(reqAddr)
if len(ret) == 0 {
panic("no return value specified for UDP")
}
var r0 UDPConn
var r1 error
if rf, ok := ret.Get(0).(func(*AddrEx) (UDPConn, error)); ok {
return rf(reqAddr)
}
if rf, ok := ret.Get(0).(func(*AddrEx) UDPConn); ok {
r0 = rf(reqAddr)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(UDPConn)
}
}
if rf, ok := ret.Get(1).(func(*AddrEx) error); ok {
r1 = rf(reqAddr)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockPluggableOutbound_UDP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UDP'
type mockPluggableOutbound_UDP_Call struct {
*mock.Call
}
// UDP is a helper method to define mock.On call
// - reqAddr *AddrEx
func (_e *mockPluggableOutbound_Expecter) UDP(reqAddr interface{}) *mockPluggableOutbound_UDP_Call {
return &mockPluggableOutbound_UDP_Call{Call: _e.mock.On("UDP", reqAddr)}
}
func (_c *mockPluggableOutbound_UDP_Call) Run(run func(reqAddr *AddrEx)) *mockPluggableOutbound_UDP_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*AddrEx))
})
return _c
}
func (_c *mockPluggableOutbound_UDP_Call) Return(_a0 UDPConn, _a1 error) *mockPluggableOutbound_UDP_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *mockPluggableOutbound_UDP_Call) RunAndReturn(run func(*AddrEx) (UDPConn, error)) *mockPluggableOutbound_UDP_Call {
_c.Call.Return(run)
return _c
}
// newMockPluggableOutbound creates a new instance of mockPluggableOutbound. 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 newMockPluggableOutbound(t interface {
mock.TestingT
Cleanup(func())
}) *mockPluggableOutbound {
mock := &mockPluggableOutbound{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}