// Code generated by pegomock. DO NOT EDIT.
// Source: github.com/runatlantis/atlantis/server/core/runtime/policy (interfaces: SourceResolver)

package mocks

import (
	pegomock "github.com/petergtz/pegomock/v4"
	valid "github.com/runatlantis/atlantis/server/core/config/valid"
	"reflect"
	"time"
)

type MockSourceResolver struct {
	fail func(message string, callerSkip ...int)
}

func NewMockSourceResolver(options ...pegomock.Option) *MockSourceResolver {
	mock := &MockSourceResolver{}
	for _, option := range options {
		option.Apply(mock)
	}
	return mock
}

func (mock *MockSourceResolver) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
func (mock *MockSourceResolver) FailHandler() pegomock.FailHandler      { return mock.fail }

func (mock *MockSourceResolver) Resolve(policySet valid.PolicySet) (string, error) {
	if mock == nil {
		panic("mock must not be nil. Use myMock := NewMockSourceResolver().")
	}
	_params := []pegomock.Param{policySet}
	_result := pegomock.GetGenericMockFrom(mock).Invoke("Resolve", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
	var _ret0 string
	var _ret1 error
	if len(_result) != 0 {
		if _result[0] != nil {
			_ret0 = _result[0].(string)
		}
		if _result[1] != nil {
			_ret1 = _result[1].(error)
		}
	}
	return _ret0, _ret1
}

func (mock *MockSourceResolver) VerifyWasCalledOnce() *VerifierMockSourceResolver {
	return &VerifierMockSourceResolver{
		mock:                   mock,
		invocationCountMatcher: pegomock.Times(1),
	}
}

func (mock *MockSourceResolver) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockSourceResolver {
	return &VerifierMockSourceResolver{
		mock:                   mock,
		invocationCountMatcher: invocationCountMatcher,
	}
}

func (mock *MockSourceResolver) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockSourceResolver {
	return &VerifierMockSourceResolver{
		mock:                   mock,
		invocationCountMatcher: invocationCountMatcher,
		inOrderContext:         inOrderContext,
	}
}

func (mock *MockSourceResolver) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockSourceResolver {
	return &VerifierMockSourceResolver{
		mock:                   mock,
		invocationCountMatcher: invocationCountMatcher,
		timeout:                timeout,
	}
}

type VerifierMockSourceResolver struct {
	mock                   *MockSourceResolver
	invocationCountMatcher pegomock.InvocationCountMatcher
	inOrderContext         *pegomock.InOrderContext
	timeout                time.Duration
}

func (verifier *VerifierMockSourceResolver) Resolve(policySet valid.PolicySet) *MockSourceResolver_Resolve_OngoingVerification {
	_params := []pegomock.Param{policySet}
	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Resolve", _params, verifier.timeout)
	return &MockSourceResolver_Resolve_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}

type MockSourceResolver_Resolve_OngoingVerification struct {
	mock              *MockSourceResolver
	methodInvocations []pegomock.MethodInvocation
}

func (c *MockSourceResolver_Resolve_OngoingVerification) GetCapturedArguments() valid.PolicySet {
	policySet := c.GetAllCapturedArguments()
	return policySet[len(policySet)-1]
}

func (c *MockSourceResolver_Resolve_OngoingVerification) GetAllCapturedArguments() (_param0 []valid.PolicySet) {
	_params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
	if len(_params) > 0 {
		if len(_params) > 0 {
			_param0 = make([]valid.PolicySet, len(c.methodInvocations))
			for u, param := range _params[0] {
				_param0[u] = param.(valid.PolicySet)
			}
		}
	}
	return
}
