github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/mocknetwork/conduit_factory.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mocknetwork 4 5 import ( 6 context "context" 7 8 channels "github.com/onflow/flow-go/network/channels" 9 10 mock "github.com/stretchr/testify/mock" 11 12 network "github.com/onflow/flow-go/network" 13 ) 14 15 // ConduitFactory is an autogenerated mock type for the ConduitFactory type 16 type ConduitFactory struct { 17 mock.Mock 18 } 19 20 // NewConduit provides a mock function with given fields: _a0, _a1 21 func (_m *ConduitFactory) NewConduit(_a0 context.Context, _a1 channels.Channel) (network.Conduit, error) { 22 ret := _m.Called(_a0, _a1) 23 24 var r0 network.Conduit 25 var r1 error 26 if rf, ok := ret.Get(0).(func(context.Context, channels.Channel) (network.Conduit, error)); ok { 27 return rf(_a0, _a1) 28 } 29 if rf, ok := ret.Get(0).(func(context.Context, channels.Channel) network.Conduit); ok { 30 r0 = rf(_a0, _a1) 31 } else { 32 if ret.Get(0) != nil { 33 r0 = ret.Get(0).(network.Conduit) 34 } 35 } 36 37 if rf, ok := ret.Get(1).(func(context.Context, channels.Channel) error); ok { 38 r1 = rf(_a0, _a1) 39 } else { 40 r1 = ret.Error(1) 41 } 42 43 return r0, r1 44 } 45 46 // RegisterAdapter provides a mock function with given fields: _a0 47 func (_m *ConduitFactory) RegisterAdapter(_a0 network.ConduitAdapter) error { 48 ret := _m.Called(_a0) 49 50 var r0 error 51 if rf, ok := ret.Get(0).(func(network.ConduitAdapter) error); ok { 52 r0 = rf(_a0) 53 } else { 54 r0 = ret.Error(0) 55 } 56 57 return r0 58 } 59 60 type mockConstructorTestingTNewConduitFactory interface { 61 mock.TestingT 62 Cleanup(func()) 63 } 64 65 // NewConduitFactory creates a new instance of ConduitFactory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 66 func NewConduitFactory(t mockConstructorTestingTNewConduitFactory) *ConduitFactory { 67 mock := &ConduitFactory{} 68 mock.Mock.Test(t) 69 70 t.Cleanup(func() { mock.AssertExpectations(t) }) 71 72 return mock 73 }