Files
atlantis/server/controllers/web_templates/mocks/mock_template_writer.go
2024-11-16 15:00:42 +00:00

114 lines
3.8 KiB
Go

// Code generated by pegomock. DO NOT EDIT.
// Source: github.com/runatlantis/atlantis/server/controllers/web_templates (interfaces: TemplateWriter)
package mocks
import (
pegomock "github.com/petergtz/pegomock/v4"
io "io"
"reflect"
"time"
)
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 {
if len(_params) > 0 {
_param0 = make([]io.Writer, len(c.methodInvocations))
for u, param := range _params[0] {
_param0[u] = param.(io.Writer)
}
}
if len(_params) > 1 {
_param1 = make([]interface{}, len(c.methodInvocations))
for u, param := range _params[1] {
_param1[u] = param.(interface{})
}
}
}
return
}