// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify

package mocks

import (
	"context"

	"github.com/actions/actions-runner-controller/cmd/ghalistener/listener"
	mock "github.com/stretchr/testify/mock"
)

// 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
}

// 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}
}

// Listen provides a mock function for the type MockListener
func (_mock *MockListener) Listen(ctx context.Context, handler listener.Handler) error {
	ret := _mock.Called(ctx, handler)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, listener.Handler) error); ok {
		r0 = returnFunc(ctx, handler)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Listen is a helper method to define mock.On call
//   - ctx context.Context
//   - handler listener.Handler
func (_e *MockListener_Expecter) Listen(ctx interface{}, handler interface{}) *MockListener_Listen_Call {
	return &MockListener_Listen_Call{Call: _e.mock.On("Listen", ctx, handler)}
}

func (_c *MockListener_Listen_Call) Run(run func(ctx context.Context, handler listener.Handler)) *MockListener_Listen_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 listener.Handler
		if args[1] != nil {
			arg1 = args[1].(listener.Handler)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *MockListener_Listen_Call) Return(err error) *MockListener_Listen_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *MockListener_Listen_Call) RunAndReturn(run func(ctx context.Context, handler listener.Handler) error) *MockListener_Listen_Call {
	_c.Call.Return(run)
	return _c
}
