-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
mock_event_subscriber.go
37 lines (29 loc) · 1.09 KB
/
mock_event_subscriber.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
// Code generated by mockery v2.14.0. DO NOT EDIT.
package ddd
import mock "github.com/stretchr/testify/mock"
// MockEventSubscriber is an autogenerated mock type for the EventSubscriber type
type MockEventSubscriber[T Event] struct {
mock.Mock
}
// Subscribe provides a mock function with given fields: handler, events
func (_m *MockEventSubscriber[T]) Subscribe(handler EventHandler[T], events ...string) {
_va := make([]interface{}, len(events))
for _i := range events {
_va[_i] = events[_i]
}
var _ca []interface{}
_ca = append(_ca, handler)
_ca = append(_ca, _va...)
_m.Called(_ca...)
}
type mockConstructorTestingTNewMockEventSubscriber interface {
mock.TestingT
Cleanup(func())
}
// NewMockEventSubscriber creates a new instance of MockEventSubscriber. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewMockEventSubscriber[T Event](t mockConstructorTestingTNewMockEventSubscriber) *MockEventSubscriber[T] {
mock := &MockEventSubscriber[T]{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}