mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-05 09:48:32 +00:00
117 lines
4.4 KiB
Go
117 lines
4.4 KiB
Go
// Automatically generated by pegomock. DO NOT EDIT!
|
|
// Source: github.com/runatlantis/atlantis/server/events (interfaces: ProjectCommandRunner)
|
|
|
|
package mocks
|
|
|
|
import (
|
|
"reflect"
|
|
|
|
pegomock "github.com/petergtz/pegomock"
|
|
events "github.com/runatlantis/atlantis/server/events"
|
|
models "github.com/runatlantis/atlantis/server/events/models"
|
|
)
|
|
|
|
type MockProjectCommandRunner struct {
|
|
fail func(message string, callerSkip ...int)
|
|
}
|
|
|
|
func NewMockProjectCommandRunner() *MockProjectCommandRunner {
|
|
return &MockProjectCommandRunner{fail: pegomock.GlobalFailHandler}
|
|
}
|
|
|
|
func (mock *MockProjectCommandRunner) Plan(ctx models.ProjectCommandContext) events.ProjectResult {
|
|
params := []pegomock.Param{ctx}
|
|
result := pegomock.GetGenericMockFrom(mock).Invoke("Plan", params, []reflect.Type{reflect.TypeOf((*events.ProjectResult)(nil)).Elem()})
|
|
var ret0 events.ProjectResult
|
|
if len(result) != 0 {
|
|
if result[0] != nil {
|
|
ret0 = result[0].(events.ProjectResult)
|
|
}
|
|
}
|
|
return ret0
|
|
}
|
|
|
|
func (mock *MockProjectCommandRunner) Apply(ctx models.ProjectCommandContext) events.ProjectResult {
|
|
params := []pegomock.Param{ctx}
|
|
result := pegomock.GetGenericMockFrom(mock).Invoke("Apply", params, []reflect.Type{reflect.TypeOf((*events.ProjectResult)(nil)).Elem()})
|
|
var ret0 events.ProjectResult
|
|
if len(result) != 0 {
|
|
if result[0] != nil {
|
|
ret0 = result[0].(events.ProjectResult)
|
|
}
|
|
}
|
|
return ret0
|
|
}
|
|
|
|
func (mock *MockProjectCommandRunner) VerifyWasCalledOnce() *VerifierProjectCommandRunner {
|
|
return &VerifierProjectCommandRunner{mock, pegomock.Times(1), nil}
|
|
}
|
|
|
|
func (mock *MockProjectCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierProjectCommandRunner {
|
|
return &VerifierProjectCommandRunner{mock, invocationCountMatcher, nil}
|
|
}
|
|
|
|
func (mock *MockProjectCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierProjectCommandRunner {
|
|
return &VerifierProjectCommandRunner{mock, invocationCountMatcher, inOrderContext}
|
|
}
|
|
|
|
type VerifierProjectCommandRunner struct {
|
|
mock *MockProjectCommandRunner
|
|
invocationCountMatcher pegomock.Matcher
|
|
inOrderContext *pegomock.InOrderContext
|
|
}
|
|
|
|
func (verifier *VerifierProjectCommandRunner) Plan(ctx models.ProjectCommandContext) *ProjectCommandRunner_Plan_OngoingVerification {
|
|
params := []pegomock.Param{ctx}
|
|
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Plan", params)
|
|
return &ProjectCommandRunner_Plan_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
|
|
}
|
|
|
|
type ProjectCommandRunner_Plan_OngoingVerification struct {
|
|
mock *MockProjectCommandRunner
|
|
methodInvocations []pegomock.MethodInvocation
|
|
}
|
|
|
|
func (c *ProjectCommandRunner_Plan_OngoingVerification) GetCapturedArguments() models.ProjectCommandContext {
|
|
ctx := c.GetAllCapturedArguments()
|
|
return ctx[len(ctx)-1]
|
|
}
|
|
|
|
func (c *ProjectCommandRunner_Plan_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectCommandContext) {
|
|
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
|
|
if len(params) > 0 {
|
|
_param0 = make([]models.ProjectCommandContext, len(params[0]))
|
|
for u, param := range params[0] {
|
|
_param0[u] = param.(models.ProjectCommandContext)
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
func (verifier *VerifierProjectCommandRunner) Apply(ctx models.ProjectCommandContext) *ProjectCommandRunner_Apply_OngoingVerification {
|
|
params := []pegomock.Param{ctx}
|
|
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Apply", params)
|
|
return &ProjectCommandRunner_Apply_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
|
|
}
|
|
|
|
type ProjectCommandRunner_Apply_OngoingVerification struct {
|
|
mock *MockProjectCommandRunner
|
|
methodInvocations []pegomock.MethodInvocation
|
|
}
|
|
|
|
func (c *ProjectCommandRunner_Apply_OngoingVerification) GetCapturedArguments() models.ProjectCommandContext {
|
|
ctx := c.GetAllCapturedArguments()
|
|
return ctx[len(ctx)-1]
|
|
}
|
|
|
|
func (c *ProjectCommandRunner_Apply_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectCommandContext) {
|
|
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
|
|
if len(params) > 0 {
|
|
_param0 = make([]models.ProjectCommandContext, len(params[0]))
|
|
for u, param := range params[0] {
|
|
_param0[u] = param.(models.ProjectCommandContext)
|
|
}
|
|
}
|
|
return
|
|
}
|