forked from runatlantis/atlantis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mock_comment_parsing.go
81 lines (67 loc) · 2.97 KB
/
mock_comment_parsing.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Automatically generated by pegomock. DO NOT EDIT!
// Source: github.com/runatlantis/atlantis/server/events (interfaces: CommentParsing)
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 MockCommentParsing struct {
fail func(message string, callerSkip ...int)
}
func NewMockCommentParsing() *MockCommentParsing {
return &MockCommentParsing{fail: pegomock.GlobalFailHandler}
}
func (mock *MockCommentParsing) Parse(comment string, vcsHost models.VCSHostType) events.CommentParseResult {
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() *VerifierCommentParsing {
return &VerifierCommentParsing{mock, pegomock.Times(1), nil}
}
func (mock *MockCommentParsing) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierCommentParsing {
return &VerifierCommentParsing{mock, invocationCountMatcher, nil}
}
func (mock *MockCommentParsing) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierCommentParsing {
return &VerifierCommentParsing{mock, invocationCountMatcher, inOrderContext}
}
type VerifierCommentParsing struct {
mock *MockCommentParsing
invocationCountMatcher pegomock.Matcher
inOrderContext *pegomock.InOrderContext
}
func (verifier *VerifierCommentParsing) Parse(comment string, vcsHost models.VCSHostType) *CommentParsing_Parse_OngoingVerification {
params := []pegomock.Param{comment, vcsHost}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Parse", params)
return &CommentParsing_Parse_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type CommentParsing_Parse_OngoingVerification struct {
mock *MockCommentParsing
methodInvocations []pegomock.MethodInvocation
}
func (c *CommentParsing_Parse_OngoingVerification) GetCapturedArguments() (string, models.VCSHostType) {
comment, vcsHost := c.GetAllCapturedArguments()
return comment[len(comment)-1], vcsHost[len(vcsHost)-1]
}
func (c *CommentParsing_Parse_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []models.VCSHostType) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]string, len(params[0]))
for u, param := range params[0] {
_param0[u] = param.(string)
}
_param1 = make([]models.VCSHostType, len(params[1]))
for u, param := range params[1] {
_param1[u] = param.(models.VCSHostType)
}
}
return
}