// Code generated by mockery v2.13.0-beta.1. DO NOT EDIT.

package dispatcher

import (
	context "context"

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

// DispatcherMock is an autogenerated mock type for the Dispatcher type
type DispatcherMock[T interface{}] struct {
	mock.Mock
}

// Dispatch provides a mock function with given fields: ctx, t
func (_m *DispatcherMock[T]) Dispatch(ctx context.Context, t T) error {
	ret := _m.Called(ctx, t)

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

	return r0
}

// Stop provides a mock function with given fields:
func (_m *DispatcherMock[T]) Stop() {
	_m.Called()
}

// Subscribe provides a mock function with given fields: _a0
func (_m *DispatcherMock[T]) Subscribe(_a0 context.Context) (chan T, error) {
	ret := _m.Called(_a0)

	var r0 chan T
	if rf, ok := ret.Get(0).(func(context.Context) chan T); ok {
		r0 = rf(_a0)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(chan T)
		}
	}

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

	return r0, r1
}

// Unsubscribe provides a mock function with given fields: _a0
func (_m *DispatcherMock[T]) Unsubscribe(_a0 chan T) error {
	ret := _m.Called(_a0)

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

	return r0
}

type NewDispatcherMockT interface {
	mock.TestingT
	Cleanup(func())
}

// NewDispatcherMock creates a new instance of DispatcherMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewDispatcherMock[T interface{}](t NewDispatcherMockT) *DispatcherMock[T] {
	mock := &DispatcherMock[T]{}
	mock.Mock.Test(t)

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

	return mock
}
