Files
atlantis/server/events/mocks/mock_comment_parsing.go
2024-11-16 15:00:42 +00:00

115 lines
4.0 KiB
Go

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