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