Files
atlantis/server/events/mocks/mock_project_command_runner.go
2020-05-25 11:58:50 -07:00

148 lines
5.5 KiB
Go

// Code generated by pegomock. DO NOT EDIT.
// Source: github.com/runatlantis/atlantis/server/events (interfaces: ProjectCommandRunner)
package mocks
import (
pegomock "github.com/petergtz/pegomock"
models "github.com/runatlantis/atlantis/server/events/models"
"reflect"
"time"
)
type MockProjectCommandRunner struct {
fail func(message string, callerSkip ...int)
}
func NewMockProjectCommandRunner(options ...pegomock.Option) *MockProjectCommandRunner {
mock := &MockProjectCommandRunner{}
for _, option := range options {
option.Apply(mock)
}
return mock
}
func (mock *MockProjectCommandRunner) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
func (mock *MockProjectCommandRunner) FailHandler() pegomock.FailHandler { return mock.fail }
func (mock *MockProjectCommandRunner) Plan(ctx models.ProjectCommandContext) models.ProjectResult {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockProjectCommandRunner().")
}
params := []pegomock.Param{ctx}
result := pegomock.GetGenericMockFrom(mock).Invoke("Plan", params, []reflect.Type{reflect.TypeOf((*models.ProjectResult)(nil)).Elem()})
var ret0 models.ProjectResult
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].(models.ProjectResult)
}
}
return ret0
}
func (mock *MockProjectCommandRunner) Apply(ctx models.ProjectCommandContext) models.ProjectResult {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockProjectCommandRunner().")
}
params := []pegomock.Param{ctx}
result := pegomock.GetGenericMockFrom(mock).Invoke("Apply", params, []reflect.Type{reflect.TypeOf((*models.ProjectResult)(nil)).Elem()})
var ret0 models.ProjectResult
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].(models.ProjectResult)
}
}
return ret0
}
func (mock *MockProjectCommandRunner) VerifyWasCalledOnce() *VerifierMockProjectCommandRunner {
return &VerifierMockProjectCommandRunner{
mock: mock,
invocationCountMatcher: pegomock.Times(1),
}
}
func (mock *MockProjectCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockProjectCommandRunner {
return &VerifierMockProjectCommandRunner{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
}
}
func (mock *MockProjectCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectCommandRunner {
return &VerifierMockProjectCommandRunner{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
inOrderContext: inOrderContext,
}
}
func (mock *MockProjectCommandRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockProjectCommandRunner {
return &VerifierMockProjectCommandRunner{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
timeout: timeout,
}
}
type VerifierMockProjectCommandRunner struct {
mock *MockProjectCommandRunner
invocationCountMatcher pegomock.Matcher
inOrderContext *pegomock.InOrderContext
timeout time.Duration
}
func (verifier *VerifierMockProjectCommandRunner) Plan(ctx models.ProjectCommandContext) *MockProjectCommandRunner_Plan_OngoingVerification {
params := []pegomock.Param{ctx}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Plan", params, verifier.timeout)
return &MockProjectCommandRunner_Plan_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockProjectCommandRunner_Plan_OngoingVerification struct {
mock *MockProjectCommandRunner
methodInvocations []pegomock.MethodInvocation
}
func (c *MockProjectCommandRunner_Plan_OngoingVerification) GetCapturedArguments() models.ProjectCommandContext {
ctx := c.GetAllCapturedArguments()
return ctx[len(ctx)-1]
}
func (c *MockProjectCommandRunner_Plan_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectCommandContext) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]models.ProjectCommandContext, len(c.methodInvocations))
for u, param := range params[0] {
_param0[u] = param.(models.ProjectCommandContext)
}
}
return
}
func (verifier *VerifierMockProjectCommandRunner) Apply(ctx models.ProjectCommandContext) *MockProjectCommandRunner_Apply_OngoingVerification {
params := []pegomock.Param{ctx}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Apply", params, verifier.timeout)
return &MockProjectCommandRunner_Apply_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockProjectCommandRunner_Apply_OngoingVerification struct {
mock *MockProjectCommandRunner
methodInvocations []pegomock.MethodInvocation
}
func (c *MockProjectCommandRunner_Apply_OngoingVerification) GetCapturedArguments() models.ProjectCommandContext {
ctx := c.GetAllCapturedArguments()
return ctx[len(ctx)-1]
}
func (c *MockProjectCommandRunner_Apply_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectCommandContext) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]models.ProjectCommandContext, len(c.methodInvocations))
for u, param := range params[0] {
_param0[u] = param.(models.ProjectCommandContext)
}
}
return
}