// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
// Copyright (c) Abstract Machines

// SPDX-License-Identifier: Apache-2.0

package mocks

import (
	"context"

	"github.com/absmach/supermq/pkg/policies"
	mock "github.com/stretchr/testify/mock"
)

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

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

	return mock
}

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

type Evaluator_Expecter struct {
	mock *mock.Mock
}

func (_m *Evaluator) EXPECT() *Evaluator_Expecter {
	return &Evaluator_Expecter{mock: &_m.Mock}
}

// CheckPolicy provides a mock function for the type Evaluator
func (_mock *Evaluator) CheckPolicy(ctx context.Context, pr policies.Policy) error {
	ret := _mock.Called(ctx, pr)

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

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

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

// CheckPolicy is a helper method to define mock.On call
//   - ctx context.Context
//   - pr policies.Policy
func (_e *Evaluator_Expecter) CheckPolicy(ctx interface{}, pr interface{}) *Evaluator_CheckPolicy_Call {
	return &Evaluator_CheckPolicy_Call{Call: _e.mock.On("CheckPolicy", ctx, pr)}
}

func (_c *Evaluator_CheckPolicy_Call) Run(run func(ctx context.Context, pr policies.Policy)) *Evaluator_CheckPolicy_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 policies.Policy
		if args[1] != nil {
			arg1 = args[1].(policies.Policy)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

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

func (_c *Evaluator_CheckPolicy_Call) RunAndReturn(run func(ctx context.Context, pr policies.Policy) error) *Evaluator_CheckPolicy_Call {
	_c.Call.Return(run)
	return _c
}
