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

package mocks

import (
	"reflect"

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

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

func NewMockPullCleaner() *MockPullCleaner {
	return &MockPullCleaner{fail: pegomock.GlobalFailHandler}
}

func (mock *MockPullCleaner) CleanUpPull(repo models.Repo, pull models.PullRequest, host vcs.Host) error {
	params := []pegomock.Param{repo, pull, host}
	result := pegomock.GetGenericMockFrom(mock).Invoke("CleanUpPull", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()})
	var ret0 error
	if len(result) != 0 {
		if result[0] != nil {
			ret0 = result[0].(error)
		}
	}
	return ret0
}

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

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

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

type VerifierPullCleaner struct {
	mock                   *MockPullCleaner
	invocationCountMatcher pegomock.Matcher
	inOrderContext         *pegomock.InOrderContext
}

func (verifier *VerifierPullCleaner) CleanUpPull(repo models.Repo, pull models.PullRequest, host vcs.Host) *PullCleaner_CleanUpPull_OngoingVerification {
	params := []pegomock.Param{repo, pull, host}
	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CleanUpPull", params)
	return &PullCleaner_CleanUpPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}

type PullCleaner_CleanUpPull_OngoingVerification struct {
	mock              *MockPullCleaner
	methodInvocations []pegomock.MethodInvocation
}

func (c *PullCleaner_CleanUpPull_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, vcs.Host) {
	repo, pull, host := c.GetAllCapturedArguments()
	return repo[len(repo)-1], pull[len(pull)-1], host[len(host)-1]
}

func (c *PullCleaner_CleanUpPull_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []vcs.Host) {
	params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
	if len(params) > 0 {
		_param0 = make([]models.Repo, len(params[0]))
		for u, param := range params[0] {
			_param0[u] = param.(models.Repo)
		}
		_param1 = make([]models.PullRequest, len(params[1]))
		for u, param := range params[1] {
			_param1[u] = param.(models.PullRequest)
		}
		_param2 = make([]vcs.Host, len(params[2]))
		for u, param := range params[2] {
			_param2[u] = param.(vcs.Host)
		}
	}
	return
}
