// Code generated by pegomock. DO NOT EDIT.
// Source: github.com/runatlantis/atlantis/server/controllers/templates (interfaces: TemplateWriter)

package mocks

import (
	io "io"
	"reflect"
	"time"

	pegomock "github.com/petergtz/pegomock"
)

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

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

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

func (mock *MockTemplateWriter) Execute(wr io.Writer, data interface{}) error {
	if mock == nil {
		panic("mock must not be nil. Use myMock := NewMockTemplateWriter().")
	}
	params := []pegomock.Param{wr, data}
	result := pegomock.GetGenericMockFrom(mock).Invoke("Execute", 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 *MockTemplateWriter) VerifyWasCalledOnce() *VerifierMockTemplateWriter {
	return &VerifierMockTemplateWriter{
		mock:                   mock,
		invocationCountMatcher: pegomock.Times(1),
	}
}

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

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

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

type VerifierMockTemplateWriter struct {
	mock                   *MockTemplateWriter
	invocationCountMatcher pegomock.InvocationCountMatcher
	inOrderContext         *pegomock.InOrderContext
	timeout                time.Duration
}

func (verifier *VerifierMockTemplateWriter) Execute(wr io.Writer, data interface{}) *MockTemplateWriter_Execute_OngoingVerification {
	params := []pegomock.Param{wr, data}
	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Execute", params, verifier.timeout)
	return &MockTemplateWriter_Execute_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}

type MockTemplateWriter_Execute_OngoingVerification struct {
	mock              *MockTemplateWriter
	methodInvocations []pegomock.MethodInvocation
}

func (c *MockTemplateWriter_Execute_OngoingVerification) GetCapturedArguments() (io.Writer, interface{}) {
	wr, data := c.GetAllCapturedArguments()
	return wr[len(wr)-1], data[len(data)-1]
}

func (c *MockTemplateWriter_Execute_OngoingVerification) GetAllCapturedArguments() (_param0 []io.Writer, _param1 []interface{}) {
	params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
	if len(params) > 0 {
		_param0 = make([]io.Writer, len(c.methodInvocations))
		for u, param := range params[0] {
			_param0[u] = param.(io.Writer)
		}
		_param1 = make([]interface{}, len(c.methodInvocations))
		for u, param := range params[1] {
			_param1[u] = param.(interface{})
		}
	}
	return
}
