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

package mocks

import (
	"context"

	mock "github.com/stretchr/testify/mock"
	"go.woodpecker-ci.org/woodpecker/v3/server/model"
)

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

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

	return mock
}

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

type MockRefresher_Expecter struct {
	mock *mock.Mock
}

func (_m *MockRefresher) EXPECT() *MockRefresher_Expecter {
	return &MockRefresher_Expecter{mock: &_m.Mock}
}

// Refresh provides a mock function for the type MockRefresher
func (_mock *MockRefresher) Refresh(ctx context.Context, u *model.User) (bool, error) {
	ret := _mock.Called(ctx, u)

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

	var r0 bool
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User) (bool, error)); ok {
		return returnFunc(ctx, u)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User) bool); ok {
		r0 = returnFunc(ctx, u)
	} else {
		r0 = ret.Get(0).(bool)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User) error); ok {
		r1 = returnFunc(ctx, u)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Refresh is a helper method to define mock.On call
//   - ctx context.Context
//   - u *model.User
func (_e *MockRefresher_Expecter) Refresh(ctx interface{}, u interface{}) *MockRefresher_Refresh_Call {
	return &MockRefresher_Refresh_Call{Call: _e.mock.On("Refresh", ctx, u)}
}

func (_c *MockRefresher_Refresh_Call) Run(run func(ctx context.Context, u *model.User)) *MockRefresher_Refresh_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *model.User
		if args[1] != nil {
			arg1 = args[1].(*model.User)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *MockRefresher_Refresh_Call) Return(b bool, err error) *MockRefresher_Refresh_Call {
	_c.Call.Return(b, err)
	return _c
}

func (_c *MockRefresher_Refresh_Call) RunAndReturn(run func(ctx context.Context, u *model.User) (bool, error)) *MockRefresher_Refresh_Call {
	_c.Call.Return(run)
	return _c
}
