// Automatically generated by pegomock. DO NOT EDIT!
// Source: github.com/hootsuite/atlantis/server/events (interfaces: ProjectPreExecutor)

package mocks

import (
	"reflect"

	events "github.com/hootsuite/atlantis/server/events"
	models "github.com/hootsuite/atlantis/server/events/models"
	pegomock "github.com/petergtz/pegomock"
)

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

func NewMockProjectPreExecutor() *MockProjectPreExecutor {
	return &MockProjectPreExecutor{fail: pegomock.GlobalFailHandler}
}

func (mock *MockProjectPreExecutor) Execute(ctx *events.CommandContext, repoDir string, project models.Project) events.PreExecuteResult {
	params := []pegomock.Param{ctx, repoDir, project}
	result := pegomock.GetGenericMockFrom(mock).Invoke("Execute", params, []reflect.Type{reflect.TypeOf((*events.PreExecuteResult)(nil)).Elem()})
	var ret0 events.PreExecuteResult
	if len(result) != 0 {
		if result[0] != nil {
			ret0 = result[0].(events.PreExecuteResult)
		}
	}
	return ret0
}

func (mock *MockProjectPreExecutor) VerifyWasCalledOnce() *VerifierProjectPreExecutor {
	return &VerifierProjectPreExecutor{mock, pegomock.Times(1), nil}
}

func (mock *MockProjectPreExecutor) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierProjectPreExecutor {
	return &VerifierProjectPreExecutor{mock, invocationCountMatcher, nil}
}

func (mock *MockProjectPreExecutor) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierProjectPreExecutor {
	return &VerifierProjectPreExecutor{mock, invocationCountMatcher, inOrderContext}
}

type VerifierProjectPreExecutor struct {
	mock                   *MockProjectPreExecutor
	invocationCountMatcher pegomock.Matcher
	inOrderContext         *pegomock.InOrderContext
}

func (verifier *VerifierProjectPreExecutor) Execute(ctx *events.CommandContext, repoDir string, project models.Project) *ProjectPreExecutor_Execute_OngoingVerification {
	params := []pegomock.Param{ctx, repoDir, project}
	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Execute", params)
	return &ProjectPreExecutor_Execute_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}

type ProjectPreExecutor_Execute_OngoingVerification struct {
	mock              *MockProjectPreExecutor
	methodInvocations []pegomock.MethodInvocation
}

func (c *ProjectPreExecutor_Execute_OngoingVerification) GetCapturedArguments() (*events.CommandContext, string, models.Project) {
	ctx, repoDir, project := c.GetAllCapturedArguments()
	return ctx[len(ctx)-1], repoDir[len(repoDir)-1], project[len(project)-1]
}

func (c *ProjectPreExecutor_Execute_OngoingVerification) GetAllCapturedArguments() (_param0 []*events.CommandContext, _param1 []string, _param2 []models.Project) {
	params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
	if len(params) > 0 {
		_param0 = make([]*events.CommandContext, len(params[0]))
		for u, param := range params[0] {
			_param0[u] = param.(*events.CommandContext)
		}
		_param1 = make([]string, len(params[1]))
		for u, param := range params[1] {
			_param1[u] = param.(string)
		}
		_param2 = make([]models.Project, len(params[2]))
		for u, param := range params[2] {
			_param2[u] = param.(models.Project)
		}
	}
	return
}
