-
Notifications
You must be signed in to change notification settings - Fork 2
/
queue_mock_test.go
49 lines (40 loc) · 1.08 KB
/
queue_mock_test.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
/*
* CODE GENERATED AUTOMATICALLY WITH github.com/ernesto-jimenez/goautomock
* THIS FILE MUST NEVER BE EDITED MANUALLY
*/
package crawler
// QueueMock mock
type QueueMock struct {
calls map[string]int
PopFrontFunc func() (*Request, error)
PushBackFunc func(*Request) error
}
func NewQueueMock() *QueueMock {
return &QueueMock{
calls: make(map[string]int),
}
}
// PopFront mocked method
func (m *QueueMock) PopFront() (*Request, error) {
if m.PopFrontFunc == nil {
panic("unexpected call to mocked method PopFront")
}
m.calls["PopFront"]++
return m.PopFrontFunc()
}
// PopFrontCalls returns the amount of calls to the mocked method PopFront
func (m *QueueMock) PopFrontTotalCalls() int {
return m.calls["PopFront"]
}
// PushBack mocked method
func (m *QueueMock) PushBack(p0 *Request) error {
if m.PushBackFunc == nil {
panic("unexpected call to mocked method PushBack")
}
m.calls["PushBack"]++
return m.PushBackFunc(p0)
}
// PushBackCalls returns the amount of calls to the mocked method PushBack
func (m *QueueMock) PushBackTotalCalls() int {
return m.calls["PushBack"]
}