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

package mocks

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

// NewBroadcaster creates a new instance of Broadcaster. 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 NewBroadcaster[E any](t interface {
	mock.TestingT
	Cleanup(func())
}) *Broadcaster[E] {
	mock := &Broadcaster[E]{}
	mock.Mock.Test(t)

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

	return mock
}

// Broadcaster is an autogenerated mock type for the Broadcaster type
type Broadcaster[E any] struct {
	mock.Mock
}

type Broadcaster_Expecter[E any] struct {
	mock *mock.Mock
}

func (_m *Broadcaster[E]) EXPECT() *Broadcaster_Expecter[E] {
	return &Broadcaster_Expecter[E]{mock: &_m.Mock}
}

// OnAdd provides a mock function for the type Broadcaster
func (_mock *Broadcaster[E]) OnAdd(v any, b bool) {
	_mock.Called(v, b)
	return
}

// Broadcaster_OnAdd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnAdd'
type Broadcaster_OnAdd_Call[E any] struct {
	*mock.Call
}

// OnAdd is a helper method to define mock.On call
//   - v any
//   - b bool
func (_e *Broadcaster_Expecter[E]) OnAdd(v interface{}, b interface{}) *Broadcaster_OnAdd_Call[E] {
	return &Broadcaster_OnAdd_Call[E]{Call: _e.mock.On("OnAdd", v, b)}
}

func (_c *Broadcaster_OnAdd_Call[E]) Run(run func(v any, b bool)) *Broadcaster_OnAdd_Call[E] {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 any
		if args[0] != nil {
			arg0 = args[0].(any)
		}
		var arg1 bool
		if args[1] != nil {
			arg1 = args[1].(bool)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Broadcaster_OnAdd_Call[E]) Return() *Broadcaster_OnAdd_Call[E] {
	_c.Call.Return()
	return _c
}

func (_c *Broadcaster_OnAdd_Call[E]) RunAndReturn(run func(v any, b bool)) *Broadcaster_OnAdd_Call[E] {
	_c.Run(run)
	return _c
}

// OnDelete provides a mock function for the type Broadcaster
func (_mock *Broadcaster[E]) OnDelete(v any) {
	_mock.Called(v)
	return
}

// Broadcaster_OnDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnDelete'
type Broadcaster_OnDelete_Call[E any] struct {
	*mock.Call
}

// OnDelete is a helper method to define mock.On call
//   - v any
func (_e *Broadcaster_Expecter[E]) OnDelete(v interface{}) *Broadcaster_OnDelete_Call[E] {
	return &Broadcaster_OnDelete_Call[E]{Call: _e.mock.On("OnDelete", v)}
}

func (_c *Broadcaster_OnDelete_Call[E]) Run(run func(v any)) *Broadcaster_OnDelete_Call[E] {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 any
		if args[0] != nil {
			arg0 = args[0].(any)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *Broadcaster_OnDelete_Call[E]) Return() *Broadcaster_OnDelete_Call[E] {
	_c.Call.Return()
	return _c
}

func (_c *Broadcaster_OnDelete_Call[E]) RunAndReturn(run func(v any)) *Broadcaster_OnDelete_Call[E] {
	_c.Run(run)
	return _c
}

// OnUpdate provides a mock function for the type Broadcaster
func (_mock *Broadcaster[E]) OnUpdate(v any, v1 any) {
	_mock.Called(v, v1)
	return
}

// Broadcaster_OnUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OnUpdate'
type Broadcaster_OnUpdate_Call[E any] struct {
	*mock.Call
}

// OnUpdate is a helper method to define mock.On call
//   - v any
//   - v1 any
func (_e *Broadcaster_Expecter[E]) OnUpdate(v interface{}, v1 interface{}) *Broadcaster_OnUpdate_Call[E] {
	return &Broadcaster_OnUpdate_Call[E]{Call: _e.mock.On("OnUpdate", v, v1)}
}

func (_c *Broadcaster_OnUpdate_Call[E]) Run(run func(v any, v1 any)) *Broadcaster_OnUpdate_Call[E] {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 any
		if args[0] != nil {
			arg0 = args[0].(any)
		}
		var arg1 any
		if args[1] != nil {
			arg1 = args[1].(any)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Broadcaster_OnUpdate_Call[E]) Return() *Broadcaster_OnUpdate_Call[E] {
	_c.Call.Return()
	return _c
}

func (_c *Broadcaster_OnUpdate_Call[E]) RunAndReturn(run func(v any, v1 any)) *Broadcaster_OnUpdate_Call[E] {
	_c.Run(run)
	return _c
}

// Subscribe provides a mock function for the type Broadcaster
func (_mock *Broadcaster[E]) Subscribe(ch chan *E, filters ...func(event *E) bool) func() {
	// func(event *E) bool
	_va := make([]interface{}, len(filters))
	for _i := range filters {
		_va[_i] = filters[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, ch)
	_ca = append(_ca, _va...)
	ret := _mock.Called(_ca...)

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

	var r0 func()
	if returnFunc, ok := ret.Get(0).(func(chan *E, ...func(event *E) bool) func()); ok {
		r0 = returnFunc(ch, filters...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(func())
		}
	}
	return r0
}

// Broadcaster_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe'
type Broadcaster_Subscribe_Call[E any] struct {
	*mock.Call
}

// Subscribe is a helper method to define mock.On call
//   - ch chan *E
//   - filters ...func(event *E) bool
func (_e *Broadcaster_Expecter[E]) Subscribe(ch interface{}, filters ...interface{}) *Broadcaster_Subscribe_Call[E] {
	return &Broadcaster_Subscribe_Call[E]{Call: _e.mock.On("Subscribe",
		append([]interface{}{ch}, filters...)...)}
}

func (_c *Broadcaster_Subscribe_Call[E]) Run(run func(ch chan *E, filters ...func(event *E) bool)) *Broadcaster_Subscribe_Call[E] {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 chan *E
		if args[0] != nil {
			arg0 = args[0].(chan *E)
		}
		var arg1 []func(event *E) bool
		variadicArgs := make([]func(event *E) bool, len(args)-1)
		for i, a := range args[1:] {
			if a != nil {
				variadicArgs[i] = a.(func(event *E) bool)
			}
		}
		arg1 = variadicArgs
		run(
			arg0,
			arg1...,
		)
	})
	return _c
}

func (_c *Broadcaster_Subscribe_Call[E]) Return(fn func()) *Broadcaster_Subscribe_Call[E] {
	_c.Call.Return(fn)
	return _c
}

func (_c *Broadcaster_Subscribe_Call[E]) RunAndReturn(run func(ch chan *E, filters ...func(event *E) bool) func()) *Broadcaster_Subscribe_Call[E] {
	_c.Call.Return(run)
	return _c
}
