github.com/koko1123/flow-go-1@v0.29.6/network/mocknetwork/connection.go (about) 1 // Code generated by mockery v2.13.1. 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 if rf, ok := ret.Get(0).(func() interface{}); ok { 18 r0 = rf() 19 } else { 20 if ret.Get(0) != nil { 21 r0 = ret.Get(0).(interface{}) 22 } 23 } 24 25 var r1 error 26 if rf, ok := ret.Get(1).(func() error); ok { 27 r1 = rf() 28 } else { 29 r1 = ret.Error(1) 30 } 31 32 return r0, r1 33 } 34 35 // Send provides a mock function with given fields: msg 36 func (_m *Connection) Send(msg interface{}) error { 37 ret := _m.Called(msg) 38 39 var r0 error 40 if rf, ok := ret.Get(0).(func(interface{}) error); ok { 41 r0 = rf(msg) 42 } else { 43 r0 = ret.Error(0) 44 } 45 46 return r0 47 } 48 49 type mockConstructorTestingTNewConnection interface { 50 mock.TestingT 51 Cleanup(func()) 52 } 53 54 // 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. 55 func NewConnection(t mockConstructorTestingTNewConnection) *Connection { 56 mock := &Connection{} 57 mock.Mock.Test(t) 58 59 t.Cleanup(func() { mock.AssertExpectations(t) }) 60 61 return mock 62 }