-
Notifications
You must be signed in to change notification settings - Fork 0
/
dealflow_mock.go
228 lines (215 loc) · 8.03 KB
/
dealflow_mock.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package go_hubspot
import (
"sync"
)
// Ensure, that IHubspotDealFlowAPIMock does implement IHubspotDealFlowAPI.
// If this is not the case, regenerate this file with moq.
var _ IHubspotDealFlowAPI = &IHubspotDealFlowAPIMock{}
// IHubspotDealFlowAPIMock is a mock implementation of IHubspotDealFlowAPI.
//
// func TestSomethingThatUsesIHubspotDealFlowAPI(t *testing.T) {
//
// // make and configure a mocked IHubspotDealFlowAPI
// mockedIHubspotDealFlowAPI := &IHubspotDealFlowAPIMock{
// AssociateDealFlowCardFunc: func(dealId string, assocId string, objectType string, assocType string) error {
// panic("mock out the AssociateDealFlowCard method")
// },
// CreateDealFlowCardFunc: func(cardName string, contactID string, contactAssocType string, companyID string, stageName string, pipeline string, ownerId string, otherProperties map[string]string) (*DealCreationResponse, error) {
// panic("mock out the CreateDealFlowCard method")
// },
// UpdateDealFlowCardFunc: func(dealId string, properties map[string]string) error {
// panic("mock out the UpdateDealFlowCard method")
// },
// }
//
// // use mockedIHubspotDealFlowAPI in code that requires IHubspotDealFlowAPI
// // and then make assertions.
//
// }
type IHubspotDealFlowAPIMock struct {
// AssociateDealFlowCardFunc mocks the AssociateDealFlowCard method.
AssociateDealFlowCardFunc func(dealId string, assocId string, objectType string, assocType string) error
// CreateDealFlowCardFunc mocks the CreateDealFlowCard method.
CreateDealFlowCardFunc func(cardName string, contactID string, contactAssocType string, companyID string, stageName string, pipeline string, ownerId string, otherProperties map[string]string) (*DealCreationResponse, error)
// UpdateDealFlowCardFunc mocks the UpdateDealFlowCard method.
UpdateDealFlowCardFunc func(dealId string, properties map[string]string) error
// calls tracks calls to the methods.
calls struct {
// AssociateDealFlowCard holds details about calls to the AssociateDealFlowCard method.
AssociateDealFlowCard []struct {
// DealId is the dealId argument value.
DealId string
// AssocId is the assocId argument value.
AssocId string
// ObjectType is the objectType argument value.
ObjectType string
// AssocType is the assocType argument value.
AssocType string
}
// CreateDealFlowCard holds details about calls to the CreateDealFlowCard method.
CreateDealFlowCard []struct {
// CardName is the cardName argument value.
CardName string
// ContactID is the contactID argument value.
ContactID string
// ContactAssocType is the contactAssocType argument value.
ContactAssocType string
// CompanyID is the companyID argument value.
CompanyID string
// StageName is the stageName argument value.
StageName string
// Pipeline is the pipeline argument value.
Pipeline string
// OwnerId is the ownerId argument value.
OwnerId string
// OtherProperties is the otherProperties argument value.
OtherProperties map[string]string
}
// UpdateDealFlowCard holds details about calls to the UpdateDealFlowCard method.
UpdateDealFlowCard []struct {
// DealId is the dealId argument value.
DealId string
// Properties is the properties argument value.
Properties map[string]string
}
}
lockAssociateDealFlowCard sync.RWMutex
lockCreateDealFlowCard sync.RWMutex
lockUpdateDealFlowCard sync.RWMutex
}
// AssociateDealFlowCard calls AssociateDealFlowCardFunc.
func (mock *IHubspotDealFlowAPIMock) AssociateDealFlowCard(dealId string, assocId string, objectType string, assocType string) error {
if mock.AssociateDealFlowCardFunc == nil {
panic("IHubspotDealFlowAPIMock.AssociateDealFlowCardFunc: method is nil but IHubspotDealFlowAPI.AssociateDealFlowCard was just called")
}
callInfo := struct {
DealId string
AssocId string
ObjectType string
AssocType string
}{
DealId: dealId,
AssocId: assocId,
ObjectType: objectType,
AssocType: assocType,
}
mock.lockAssociateDealFlowCard.Lock()
mock.calls.AssociateDealFlowCard = append(mock.calls.AssociateDealFlowCard, callInfo)
mock.lockAssociateDealFlowCard.Unlock()
return mock.AssociateDealFlowCardFunc(dealId, assocId, objectType, assocType)
}
// AssociateDealFlowCardCalls gets all the calls that were made to AssociateDealFlowCard.
// Check the length with:
//
// len(mockedIHubspotDealFlowAPI.AssociateDealFlowCardCalls())
func (mock *IHubspotDealFlowAPIMock) AssociateDealFlowCardCalls() []struct {
DealId string
AssocId string
ObjectType string
AssocType string
} {
var calls []struct {
DealId string
AssocId string
ObjectType string
AssocType string
}
mock.lockAssociateDealFlowCard.RLock()
calls = mock.calls.AssociateDealFlowCard
mock.lockAssociateDealFlowCard.RUnlock()
return calls
}
// CreateDealFlowCard calls CreateDealFlowCardFunc.
func (mock *IHubspotDealFlowAPIMock) CreateDealFlowCard(cardName string, contactID string, contactAssocType string, companyID string, stageName string, pipeline string, ownerId string, otherProperties map[string]string) (*DealCreationResponse, error) {
if mock.CreateDealFlowCardFunc == nil {
panic("IHubspotDealFlowAPIMock.CreateDealFlowCardFunc: method is nil but IHubspotDealFlowAPI.CreateDealFlowCard was just called")
}
callInfo := struct {
CardName string
ContactID string
ContactAssocType string
CompanyID string
StageName string
Pipeline string
OwnerId string
OtherProperties map[string]string
}{
CardName: cardName,
ContactID: contactID,
ContactAssocType: contactAssocType,
CompanyID: companyID,
StageName: stageName,
Pipeline: pipeline,
OwnerId: ownerId,
OtherProperties: otherProperties,
}
mock.lockCreateDealFlowCard.Lock()
mock.calls.CreateDealFlowCard = append(mock.calls.CreateDealFlowCard, callInfo)
mock.lockCreateDealFlowCard.Unlock()
return mock.CreateDealFlowCardFunc(cardName, contactID, contactAssocType, companyID, stageName, pipeline, ownerId, otherProperties)
}
// CreateDealFlowCardCalls gets all the calls that were made to CreateDealFlowCard.
// Check the length with:
//
// len(mockedIHubspotDealFlowAPI.CreateDealFlowCardCalls())
func (mock *IHubspotDealFlowAPIMock) CreateDealFlowCardCalls() []struct {
CardName string
ContactID string
ContactAssocType string
CompanyID string
StageName string
Pipeline string
OwnerId string
OtherProperties map[string]string
} {
var calls []struct {
CardName string
ContactID string
ContactAssocType string
CompanyID string
StageName string
Pipeline string
OwnerId string
OtherProperties map[string]string
}
mock.lockCreateDealFlowCard.RLock()
calls = mock.calls.CreateDealFlowCard
mock.lockCreateDealFlowCard.RUnlock()
return calls
}
// UpdateDealFlowCard calls UpdateDealFlowCardFunc.
func (mock *IHubspotDealFlowAPIMock) UpdateDealFlowCard(dealId string, properties map[string]string) error {
if mock.UpdateDealFlowCardFunc == nil {
panic("IHubspotDealFlowAPIMock.UpdateDealFlowCardFunc: method is nil but IHubspotDealFlowAPI.UpdateDealFlowCard was just called")
}
callInfo := struct {
DealId string
Properties map[string]string
}{
DealId: dealId,
Properties: properties,
}
mock.lockUpdateDealFlowCard.Lock()
mock.calls.UpdateDealFlowCard = append(mock.calls.UpdateDealFlowCard, callInfo)
mock.lockUpdateDealFlowCard.Unlock()
return mock.UpdateDealFlowCardFunc(dealId, properties)
}
// UpdateDealFlowCardCalls gets all the calls that were made to UpdateDealFlowCard.
// Check the length with:
//
// len(mockedIHubspotDealFlowAPI.UpdateDealFlowCardCalls())
func (mock *IHubspotDealFlowAPIMock) UpdateDealFlowCardCalls() []struct {
DealId string
Properties map[string]string
} {
var calls []struct {
DealId string
Properties map[string]string
}
mock.lockUpdateDealFlowCard.RLock()
calls = mock.calls.UpdateDealFlowCard
mock.lockUpdateDealFlowCard.RUnlock()
return calls
}