Debian Codegraph @

pkg/types/mocks/ContextSender.go

raw
1 // Code generated by mockery; DO NOT EDIT.
2 // github.com/vektra/mockery
3 // template: testify
4
5 package mocks
6
7 import (
8 "context"
9
10 "github.com/nicholas-fedor/shoutrrr/pkg/types"
11 mock "github.com/stretchr/testify/mock"
12 )
13
14 // NewMockContextSender creates a new instance of MockContextSender. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
15 // The first argument is typically a *testing.T value.
16 func NewMockContextSender(t interface {
17 mock.TestingT
18 Cleanup(func())
19 }) *MockContextSender {
20 mock := &MockContextSender{}
21 mock.Mock.Test(t)
22
23 t.Cleanup(func() { mock.AssertExpectations(t) })
24
25 return mock
26 }
27
28 // MockContextSender is an autogenerated mock type for the ContextSender type
29 type MockContextSender struct {
30 mock.Mock
31 }
32
33 type MockContextSender_Expecter struct {
34 mock *mock.Mock
35 }
36
37 func (_m *MockContextSender) EXPECT() *MockContextSender_Expecter {
38 return &MockContextSender_Expecter{mock: &_m.Mock}
39 }
40
41 // SendContext provides a mock function for the type MockContextSender
42 func (_mock *MockContextSender) SendContext(ctx context.Context, message string, params *types.Params) error {
43 ret := _mock.Called(ctx, message, params)
44
45 if len(ret) == 0 {
46 panic("no return value specified for SendContext")
47 }
48
49 var r0 error
50 if returnFunc, ok := ret.Get(0).(func(context.Context, string, *types.Params) error); ok {
51 r0 = returnFunc(ctx, message, params)
52 } else {
53 r0 = ret.Error(0)
54 }
55 return r0
56 }
57
58 // MockContextSender_SendContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendContext'
59 type MockContextSender_SendContext_Call struct {
60 *mock.Call
61 }
62
63 // SendContext is a helper method to define mock.On call
64 // - ctx context.Context
65 // - message string
66 // - params *types.Params
67 func (_e *MockContextSender_Expecter) SendContext(ctx any, message any, params any) *MockContextSender_SendContext_Call {
68 return &MockContextSender_SendContext_Call{Call: _e.mock.On("SendContext", ctx, message, params)}
69 }
70
71 func (_c *MockContextSender_SendContext_Call) Run(run func(ctx context.Context, message string, params *types.Params)) *MockContextSender_SendContext_Call {
72 _c.Call.Run(func(args mock.Arguments) {
73 var arg0 context.Context
74 if args[0] != nil {
75 arg0 = args[0].(context.Context)
76 }
77 var arg1 string
78 if args[1] != nil {
79 arg1 = args[1].(string)
80 }
81 var arg2 *types.Params
82 if args[2] != nil {
83 arg2 = args[2].(*types.Params)
84 }
85 run(
86 arg0,
87 arg1,
88 arg2,
89 )
90 })
91 return _c
92 }
93
94 func (_c *MockContextSender_SendContext_Call) Return(err error) *MockContextSender_SendContext_Call {
95 _c.Call.Return(err)
96 return _c
97 }
98
99 func (_c *MockContextSender_SendContext_Call) RunAndReturn(run func(ctx context.Context, message string, params *types.Params) error) *MockContextSender_SendContext_Call {
100 _c.Call.Return(run)
101 return _c
102 }