/
SlackBot.go
116 lines (92 loc) · 2.81 KB
/
SlackBot.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
// Code generated by mockery v2.40.1. DO NOT EDIT.
package mocks
import (
context "context"
slackbot "github.com/clambin/go-common/slackbot"
mock "github.com/stretchr/testify/mock"
)
// SlackBot is an autogenerated mock type for the SlackBot type
type SlackBot struct {
mock.Mock
}
type SlackBot_Expecter struct {
mock *mock.Mock
}
func (_m *SlackBot) EXPECT() *SlackBot_Expecter {
return &SlackBot_Expecter{mock: &_m.Mock}
}
// Add provides a mock function with given fields: commands
func (_m *SlackBot) Add(commands slackbot.Commands) {
_m.Called(commands)
}
// SlackBot_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add'
type SlackBot_Add_Call struct {
*mock.Call
}
// Add is a helper method to define mock.On call
// - commands slackbot.Commands
func (_e *SlackBot_Expecter) Add(commands interface{}) *SlackBot_Add_Call {
return &SlackBot_Add_Call{Call: _e.mock.On("Add", commands)}
}
func (_c *SlackBot_Add_Call) Run(run func(commands slackbot.Commands)) *SlackBot_Add_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(slackbot.Commands))
})
return _c
}
func (_c *SlackBot_Add_Call) Return() *SlackBot_Add_Call {
_c.Call.Return()
return _c
}
func (_c *SlackBot_Add_Call) RunAndReturn(run func(slackbot.Commands)) *SlackBot_Add_Call {
_c.Call.Return(run)
return _c
}
// Run provides a mock function with given fields: ctx
func (_m *SlackBot) Run(ctx context.Context) error {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for Run")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = rf(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// SlackBot_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run'
type SlackBot_Run_Call struct {
*mock.Call
}
// Run is a helper method to define mock.On call
// - ctx context.Context
func (_e *SlackBot_Expecter) Run(ctx interface{}) *SlackBot_Run_Call {
return &SlackBot_Run_Call{Call: _e.mock.On("Run", ctx)}
}
func (_c *SlackBot_Run_Call) Run(run func(ctx context.Context)) *SlackBot_Run_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *SlackBot_Run_Call) Return(_a0 error) *SlackBot_Run_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *SlackBot_Run_Call) RunAndReturn(run func(context.Context) error) *SlackBot_Run_Call {
_c.Call.Return(run)
return _c
}
// NewSlackBot creates a new instance of SlackBot. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewSlackBot(t interface {
mock.TestingT
Cleanup(func())
}) *SlackBot {
mock := &SlackBot{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}