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

package cachemock

import (
	"github.com/hashicorp/consul/proto-public/pbresource"
	mock "github.com/stretchr/testify/mock"
)

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

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

	return mock
}

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

type WriteCache_Expecter struct {
	mock *mock.Mock
}

func (_m *WriteCache) EXPECT() *WriteCache_Expecter {
	return &WriteCache_Expecter{mock: &_m.Mock}
}

// Delete provides a mock function for the type WriteCache
func (_mock *WriteCache) Delete(r *pbresource.Resource) error {
	ret := _mock.Called(r)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(*pbresource.Resource) error); ok {
		r0 = returnFunc(r)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Delete is a helper method to define mock.On call
//   - r *pbresource.Resource
func (_e *WriteCache_Expecter) Delete(r interface{}) *WriteCache_Delete_Call {
	return &WriteCache_Delete_Call{Call: _e.mock.On("Delete", r)}
}

func (_c *WriteCache_Delete_Call) Run(run func(r *pbresource.Resource)) *WriteCache_Delete_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 *pbresource.Resource
		if args[0] != nil {
			arg0 = args[0].(*pbresource.Resource)
		}
		run(
			arg0,
		)
	})
	return _c
}

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

func (_c *WriteCache_Delete_Call) RunAndReturn(run func(r *pbresource.Resource) error) *WriteCache_Delete_Call {
	_c.Call.Return(run)
	return _c
}

// Insert provides a mock function for the type WriteCache
func (_mock *WriteCache) Insert(r *pbresource.Resource) error {
	ret := _mock.Called(r)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(*pbresource.Resource) error); ok {
		r0 = returnFunc(r)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Insert is a helper method to define mock.On call
//   - r *pbresource.Resource
func (_e *WriteCache_Expecter) Insert(r interface{}) *WriteCache_Insert_Call {
	return &WriteCache_Insert_Call{Call: _e.mock.On("Insert", r)}
}

func (_c *WriteCache_Insert_Call) Run(run func(r *pbresource.Resource)) *WriteCache_Insert_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 *pbresource.Resource
		if args[0] != nil {
			arg0 = args[0].(*pbresource.Resource)
		}
		run(
			arg0,
		)
	})
	return _c
}

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

func (_c *WriteCache_Insert_Call) RunAndReturn(run func(r *pbresource.Resource) error) *WriteCache_Insert_Call {
	_c.Call.Return(run)
	return _c
}
