forked from hootsuite/atlantis
/
mock_project_config_reader.go
119 lines (100 loc) · 4.26 KB
/
mock_project_config_reader.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// Automatically generated by pegomock. DO NOT EDIT!
// Source: github.com/hootsuite/atlantis/server/events (interfaces: ProjectConfigReader)
package mocks
import (
"reflect"
events "github.com/hootsuite/atlantis/server/events"
pegomock "github.com/petergtz/pegomock"
)
type MockProjectConfigReader struct {
fail func(message string, callerSkip ...int)
}
func NewMockProjectConfigReader() *MockProjectConfigReader {
return &MockProjectConfigReader{fail: pegomock.GlobalFailHandler}
}
func (mock *MockProjectConfigReader) Exists(projectPath string) bool {
params := []pegomock.Param{projectPath}
result := pegomock.GetGenericMockFrom(mock).Invoke("Exists", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()})
var ret0 bool
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].(bool)
}
}
return ret0
}
func (mock *MockProjectConfigReader) Read(projectPath string) (events.ProjectConfig, error) {
params := []pegomock.Param{projectPath}
result := pegomock.GetGenericMockFrom(mock).Invoke("Read", params, []reflect.Type{reflect.TypeOf((*events.ProjectConfig)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var ret0 events.ProjectConfig
var ret1 error
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].(events.ProjectConfig)
}
if result[1] != nil {
ret1 = result[1].(error)
}
}
return ret0, ret1
}
func (mock *MockProjectConfigReader) VerifyWasCalledOnce() *VerifierProjectConfigReader {
return &VerifierProjectConfigReader{mock, pegomock.Times(1), nil}
}
func (mock *MockProjectConfigReader) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierProjectConfigReader {
return &VerifierProjectConfigReader{mock, invocationCountMatcher, nil}
}
func (mock *MockProjectConfigReader) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierProjectConfigReader {
return &VerifierProjectConfigReader{mock, invocationCountMatcher, inOrderContext}
}
type VerifierProjectConfigReader struct {
mock *MockProjectConfigReader
invocationCountMatcher pegomock.Matcher
inOrderContext *pegomock.InOrderContext
}
func (verifier *VerifierProjectConfigReader) Exists(projectPath string) *ProjectConfigReader_Exists_OngoingVerification {
params := []pegomock.Param{projectPath}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Exists", params)
return &ProjectConfigReader_Exists_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type ProjectConfigReader_Exists_OngoingVerification struct {
mock *MockProjectConfigReader
methodInvocations []pegomock.MethodInvocation
}
func (c *ProjectConfigReader_Exists_OngoingVerification) GetCapturedArguments() string {
projectPath := c.GetAllCapturedArguments()
return projectPath[len(projectPath)-1]
}
func (c *ProjectConfigReader_Exists_OngoingVerification) GetAllCapturedArguments() (_param0 []string) {
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)
}
}
return
}
func (verifier *VerifierProjectConfigReader) Read(projectPath string) *ProjectConfigReader_Read_OngoingVerification {
params := []pegomock.Param{projectPath}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Read", params)
return &ProjectConfigReader_Read_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type ProjectConfigReader_Read_OngoingVerification struct {
mock *MockProjectConfigReader
methodInvocations []pegomock.MethodInvocation
}
func (c *ProjectConfigReader_Read_OngoingVerification) GetCapturedArguments() string {
projectPath := c.GetAllCapturedArguments()
return projectPath[len(projectPath)-1]
}
func (c *ProjectConfigReader_Read_OngoingVerification) GetAllCapturedArguments() (_param0 []string) {
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)
}
}
return
}