-
Notifications
You must be signed in to change notification settings - Fork 227
/
Copy pathmock_slack_client.go
116 lines (96 loc) · 3.67 KB
/
mock_slack_client.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.43.2. DO NOT EDIT.
package slack
import (
context "context"
slack_goslack "github.com/slack-go/slack"
mock "github.com/stretchr/testify/mock"
)
// mockslackClient is an autogenerated mock type for the slackClient type
type mockslackClient struct {
mock.Mock
}
type mockslackClient_Expecter struct {
mock *mock.Mock
}
func (_m *mockslackClient) EXPECT() *mockslackClient_Expecter {
return &mockslackClient_Expecter{mock: &_m.Mock}
}
// PostMessageContext provides a mock function with given fields: ctx, channelID, options
func (_m *mockslackClient) PostMessageContext(ctx context.Context, channelID string, options ...slack_goslack.MsgOption) (string, string, error) {
_va := make([]interface{}, len(options))
for _i := range options {
_va[_i] = options[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx, channelID)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for PostMessageContext")
}
var r0 string
var r1 string
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, string, ...slack_goslack.MsgOption) (string, string, error)); ok {
return rf(ctx, channelID, options...)
}
if rf, ok := ret.Get(0).(func(context.Context, string, ...slack_goslack.MsgOption) string); ok {
r0 = rf(ctx, channelID, options...)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, string, ...slack_goslack.MsgOption) string); ok {
r1 = rf(ctx, channelID, options...)
} else {
r1 = ret.Get(1).(string)
}
if rf, ok := ret.Get(2).(func(context.Context, string, ...slack_goslack.MsgOption) error); ok {
r2 = rf(ctx, channelID, options...)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// mockslackClient_PostMessageContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PostMessageContext'
type mockslackClient_PostMessageContext_Call struct {
*mock.Call
}
// PostMessageContext is a helper method to define mock.On call
// - ctx context.Context
// - channelID string
// - options ...slack_goslack.MsgOption
func (_e *mockslackClient_Expecter) PostMessageContext(ctx interface{}, channelID interface{}, options ...interface{}) *mockslackClient_PostMessageContext_Call {
return &mockslackClient_PostMessageContext_Call{Call: _e.mock.On("PostMessageContext",
append([]interface{}{ctx, channelID}, options...)...)}
}
func (_c *mockslackClient_PostMessageContext_Call) Run(run func(ctx context.Context, channelID string, options ...slack_goslack.MsgOption)) *mockslackClient_PostMessageContext_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]slack_goslack.MsgOption, len(args)-2)
for i, a := range args[2:] {
if a != nil {
variadicArgs[i] = a.(slack_goslack.MsgOption)
}
}
run(args[0].(context.Context), args[1].(string), variadicArgs...)
})
return _c
}
func (_c *mockslackClient_PostMessageContext_Call) Return(_a0 string, _a1 string, _a2 error) *mockslackClient_PostMessageContext_Call {
_c.Call.Return(_a0, _a1, _a2)
return _c
}
func (_c *mockslackClient_PostMessageContext_Call) RunAndReturn(run func(context.Context, string, ...slack_goslack.MsgOption) (string, string, error)) *mockslackClient_PostMessageContext_Call {
_c.Call.Return(run)
return _c
}
// newMockslackClient creates a new instance of mockslackClient. 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 newMockslackClient(t interface {
mock.TestingT
Cleanup(func())
}) *mockslackClient {
mock := &mockslackClient{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}