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

package mocks

import (
	"reflect"

	go_version "github.com/hashicorp/go-version"
	logging "github.com/hootsuite/atlantis/server/logging"
	pegomock "github.com/petergtz/pegomock"
)

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

func NewMockRunner() *MockRunner {
	return &MockRunner{fail: pegomock.GlobalFailHandler}
}

func (mock *MockRunner) Execute(log *logging.SimpleLogger, commands []string, path string, workspace string, terraformVersion *go_version.Version, stage string) (string, error) {
	params := []pegomock.Param{log, commands, path, workspace, terraformVersion, stage}
	result := pegomock.GetGenericMockFrom(mock).Invoke("Execute", 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 *MockRunner) VerifyWasCalledOnce() *VerifierRunner {
	return &VerifierRunner{mock, pegomock.Times(1), nil}
}

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

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

type VerifierRunner struct {
	mock                   *MockRunner
	invocationCountMatcher pegomock.Matcher
	inOrderContext         *pegomock.InOrderContext
}

func (verifier *VerifierRunner) Execute(log *logging.SimpleLogger, commands []string, path string, workspace string, terraformVersion *go_version.Version, stage string) *Runner_Execute_OngoingVerification {
	params := []pegomock.Param{log, commands, path, workspace, terraformVersion, stage}
	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Execute", params)
	return &Runner_Execute_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}

type Runner_Execute_OngoingVerification struct {
	mock              *MockRunner
	methodInvocations []pegomock.MethodInvocation
}

func (c *Runner_Execute_OngoingVerification) GetCapturedArguments() (*logging.SimpleLogger, []string, string, string, *go_version.Version, string) {
	log, commands, path, workspace, terraformVersion, stage := c.GetAllCapturedArguments()
	return log[len(log)-1], commands[len(commands)-1], path[len(path)-1], workspace[len(workspace)-1], terraformVersion[len(terraformVersion)-1], stage[len(stage)-1]
}

func (c *Runner_Execute_OngoingVerification) GetAllCapturedArguments() (_param0 []*logging.SimpleLogger, _param1 [][]string, _param2 []string, _param3 []string, _param4 []*go_version.Version, _param5 []string) {
	params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
	if len(params) > 0 {
		_param0 = make([]*logging.SimpleLogger, len(params[0]))
		for u, param := range params[0] {
			_param0[u] = param.(*logging.SimpleLogger)
		}
		_param1 = make([][]string, len(params[1]))
		for u, param := range params[1] {
			_param1[u] = param.([]string)
		}
		_param2 = make([]string, len(params[2]))
		for u, param := range params[2] {
			_param2[u] = param.(string)
		}
		_param3 = make([]string, len(params[3]))
		for u, param := range params[3] {
			_param3[u] = param.(string)
		}
		_param4 = make([]*go_version.Version, len(params[4]))
		for u, param := range params[4] {
			_param4[u] = param.(*go_version.Version)
		}
		_param5 = make([]string, len(params[5]))
		for u, param := range params[5] {
			_param5[u] = param.(string)
		}
	}
	return
}
