// Code generated by mockery v2.42.2. DO NOT EDIT.

package mocks

import (
	net "net"

	mock "github.com/stretchr/testify/mock"
)

// MockListener is an autogenerated mock type for the Listener type
type MockListener struct {
	mock.Mock
}

type MockListener_Expecter struct {
	mock *mock.Mock
}

func (_m *MockListener) EXPECT() *MockListener_Expecter {
	return &MockListener_Expecter{mock: &_m.Mock}
}

// Accept provides a mock function with given fields:
func (_m *MockListener) Accept() (net.Conn, error) {
	ret := _m.Called()

	if len(ret) == 0 {
		panic("no return value specified for Accept")
	}

	var r0 net.Conn
	var r1 error
	if rf, ok := ret.Get(0).(func() (net.Conn, error)); ok {
		return rf()
	}
	if rf, ok := ret.Get(0).(func() net.Conn); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(net.Conn)
		}
	}

	if rf, ok := ret.Get(1).(func() error); ok {
		r1 = rf()
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// MockListener_Accept_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Accept'
type MockListener_Accept_Call struct {
	*mock.Call
}

// Accept is a helper method to define mock.On call
func (_e *MockListener_Expecter) Accept() *MockListener_Accept_Call {
	return &MockListener_Accept_Call{Call: _e.mock.On("Accept")}
}

func (_c *MockListener_Accept_Call) Run(run func()) *MockListener_Accept_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *MockListener_Accept_Call) Return(_a0 net.Conn, _a1 error) *MockListener_Accept_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *MockListener_Accept_Call) RunAndReturn(run func() (net.Conn, error)) *MockListener_Accept_Call {
	_c.Call.Return(run)
	return _c
}

// Addr provides a mock function with given fields:
func (_m *MockListener) Addr() net.Addr {
	ret := _m.Called()

	if len(ret) == 0 {
		panic("no return value specified for Addr")
	}

	var r0 net.Addr
	if rf, ok := ret.Get(0).(func() net.Addr); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(net.Addr)
		}
	}

	return r0
}

// MockListener_Addr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Addr'
type MockListener_Addr_Call struct {
	*mock.Call
}

// Addr is a helper method to define mock.On call
func (_e *MockListener_Expecter) Addr() *MockListener_Addr_Call {
	return &MockListener_Addr_Call{Call: _e.mock.On("Addr")}
}

func (_c *MockListener_Addr_Call) Run(run func()) *MockListener_Addr_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *MockListener_Addr_Call) Return(_a0 net.Addr) *MockListener_Addr_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockListener_Addr_Call) RunAndReturn(run func() net.Addr) *MockListener_Addr_Call {
	_c.Call.Return(run)
	return _c
}

// Close provides a mock function with given fields:
func (_m *MockListener) Close() error {
	ret := _m.Called()

	if len(ret) == 0 {
		panic("no return value specified for Close")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// MockListener_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
type MockListener_Close_Call struct {
	*mock.Call
}

// Close is a helper method to define mock.On call
func (_e *MockListener_Expecter) Close() *MockListener_Close_Call {
	return &MockListener_Close_Call{Call: _e.mock.On("Close")}
}

func (_c *MockListener_Close_Call) Run(run func()) *MockListener_Close_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *MockListener_Close_Call) Return(_a0 error) *MockListener_Close_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockListener_Close_Call) RunAndReturn(run func() error) *MockListener_Close_Call {
	_c.Call.Return(run)
	return _c
}

// NewMockListener creates a new instance of MockListener. 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 NewMockListener(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockListener {
	mock := &MockListener{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}
