mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-05 04:08:34 +00:00
* Moved CommandContext and CommandResult to models (#193) * Moved CommandContext and CommandResult to models * move from models to command rename CommandContext -> Context rename CommandResult -> Result * moved command related helpers into command package * move ProjectCommandContext and ProjectResult to command/project package * move project command context and project result * revert unrelated code * move tests * fix left over * fix linting * fix tests * remove unused import * fix project context dependencies * fix depenedecies * fix typo
112 lines
4.0 KiB
Go
112 lines
4.0 KiB
Go
// Code generated by pegomock. DO NOT EDIT.
|
|
// Source: github.com/runatlantis/atlantis/server/events (interfaces: CommentParsing)
|
|
|
|
package mocks
|
|
|
|
import (
|
|
"reflect"
|
|
"time"
|
|
|
|
pegomock "github.com/petergtz/pegomock"
|
|
events "github.com/runatlantis/atlantis/server/events"
|
|
models "github.com/runatlantis/atlantis/server/events/models"
|
|
)
|
|
|
|
type MockCommentParsing struct {
|
|
fail func(message string, callerSkip ...int)
|
|
}
|
|
|
|
func NewMockCommentParsing(options ...pegomock.Option) *MockCommentParsing {
|
|
mock := &MockCommentParsing{}
|
|
for _, option := range options {
|
|
option.Apply(mock)
|
|
}
|
|
return mock
|
|
}
|
|
|
|
func (mock *MockCommentParsing) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
|
|
func (mock *MockCommentParsing) FailHandler() pegomock.FailHandler { return mock.fail }
|
|
|
|
func (mock *MockCommentParsing) Parse(comment string, vcsHost models.VCSHostType) events.CommentParseResult {
|
|
if mock == nil {
|
|
panic("mock must not be nil. Use myMock := NewMockCommentParsing().")
|
|
}
|
|
params := []pegomock.Param{comment, vcsHost}
|
|
result := pegomock.GetGenericMockFrom(mock).Invoke("Parse", params, []reflect.Type{reflect.TypeOf((*events.CommentParseResult)(nil)).Elem()})
|
|
var ret0 events.CommentParseResult
|
|
if len(result) != 0 {
|
|
if result[0] != nil {
|
|
ret0 = result[0].(events.CommentParseResult)
|
|
}
|
|
}
|
|
return ret0
|
|
}
|
|
|
|
func (mock *MockCommentParsing) VerifyWasCalledOnce() *VerifierMockCommentParsing {
|
|
return &VerifierMockCommentParsing{
|
|
mock: mock,
|
|
invocationCountMatcher: pegomock.Times(1),
|
|
}
|
|
}
|
|
|
|
func (mock *MockCommentParsing) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockCommentParsing {
|
|
return &VerifierMockCommentParsing{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
}
|
|
}
|
|
|
|
func (mock *MockCommentParsing) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommentParsing {
|
|
return &VerifierMockCommentParsing{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
inOrderContext: inOrderContext,
|
|
}
|
|
}
|
|
|
|
func (mock *MockCommentParsing) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockCommentParsing {
|
|
return &VerifierMockCommentParsing{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
type VerifierMockCommentParsing struct {
|
|
mock *MockCommentParsing
|
|
invocationCountMatcher pegomock.InvocationCountMatcher
|
|
inOrderContext *pegomock.InOrderContext
|
|
timeout time.Duration
|
|
}
|
|
|
|
func (verifier *VerifierMockCommentParsing) Parse(comment string, vcsHost models.VCSHostType) *MockCommentParsing_Parse_OngoingVerification {
|
|
params := []pegomock.Param{comment, vcsHost}
|
|
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Parse", params, verifier.timeout)
|
|
return &MockCommentParsing_Parse_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
|
|
}
|
|
|
|
type MockCommentParsing_Parse_OngoingVerification struct {
|
|
mock *MockCommentParsing
|
|
methodInvocations []pegomock.MethodInvocation
|
|
}
|
|
|
|
func (c *MockCommentParsing_Parse_OngoingVerification) GetCapturedArguments() (string, models.VCSHostType) {
|
|
comment, vcsHost := c.GetAllCapturedArguments()
|
|
return comment[len(comment)-1], vcsHost[len(vcsHost)-1]
|
|
}
|
|
|
|
func (c *MockCommentParsing_Parse_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []models.VCSHostType) {
|
|
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
|
|
if len(params) > 0 {
|
|
_param0 = make([]string, len(c.methodInvocations))
|
|
for u, param := range params[0] {
|
|
_param0[u] = param.(string)
|
|
}
|
|
_param1 = make([]models.VCSHostType, len(c.methodInvocations))
|
|
for u, param := range params[1] {
|
|
_param1[u] = param.(models.VCSHostType)
|
|
}
|
|
}
|
|
return
|
|
}
|