// Code generated by mockery v2.52.2. DO NOT EDIT.

package resolver

import (
	context "context"

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

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

type mockSource_Expecter struct {
	mock *mock.Mock
}

func (_m *mockSource) EXPECT() *mockSource_Expecter {
	return &mockSource_Expecter{mock: &_m.Mock}
}

// Lookup provides a mock function with given fields: ctx, name
func (_m *mockSource) Lookup(ctx context.Context, name Name) ([]Version, error) {
	ret := _m.Called(ctx, name)

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

	var r0 []Version
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, Name) ([]Version, error)); ok {
		return rf(ctx, name)
	}
	if rf, ok := ret.Get(0).(func(context.Context, Name) []Version); ok {
		r0 = rf(ctx, name)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]Version)
		}
	}

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

	return r0, r1
}

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

// Lookup is a helper method to define mock.On call
//   - ctx context.Context
//   - name Name
func (_e *mockSource_Expecter) Lookup(ctx interface{}, name interface{}) *mockSource_Lookup_Call {
	return &mockSource_Lookup_Call{Call: _e.mock.On("Lookup", ctx, name)}
}

func (_c *mockSource_Lookup_Call) Run(run func(ctx context.Context, name Name)) *mockSource_Lookup_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(Name))
	})
	return _c
}

func (_c *mockSource_Lookup_Call) Return(_a0 []Version, _a1 error) *mockSource_Lookup_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *mockSource_Lookup_Call) RunAndReturn(run func(context.Context, Name) ([]Version, error)) *mockSource_Lookup_Call {
	_c.Call.Return(run)
	return _c
}

// Resolve provides a mock function with given fields: ctx, name, version, checksums
func (_m *mockSource) Resolve(ctx context.Context, name Name, version Version, checksums []Checksum) (*ResolvedPlugin, error) {
	ret := _m.Called(ctx, name, version, checksums)

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

	var r0 *ResolvedPlugin
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, Name, Version, []Checksum) (*ResolvedPlugin, error)); ok {
		return rf(ctx, name, version, checksums)
	}
	if rf, ok := ret.Get(0).(func(context.Context, Name, Version, []Checksum) *ResolvedPlugin); ok {
		r0 = rf(ctx, name, version, checksums)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*ResolvedPlugin)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, Name, Version, []Checksum) error); ok {
		r1 = rf(ctx, name, version, checksums)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

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

// Resolve is a helper method to define mock.On call
//   - ctx context.Context
//   - name Name
//   - version Version
//   - checksums []Checksum
func (_e *mockSource_Expecter) Resolve(ctx interface{}, name interface{}, version interface{}, checksums interface{}) *mockSource_Resolve_Call {
	return &mockSource_Resolve_Call{Call: _e.mock.On("Resolve", ctx, name, version, checksums)}
}

func (_c *mockSource_Resolve_Call) Run(run func(ctx context.Context, name Name, version Version, checksums []Checksum)) *mockSource_Resolve_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(Name), args[2].(Version), args[3].([]Checksum))
	})
	return _c
}

func (_c *mockSource_Resolve_Call) Return(_a0 *ResolvedPlugin, _a1 error) *mockSource_Resolve_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *mockSource_Resolve_Call) RunAndReturn(run func(context.Context, Name, Version, []Checksum) (*ResolvedPlugin, error)) *mockSource_Resolve_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	return mock
}
