github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/mocknetwork/write_close_flusher.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 // WriteCloseFlusher is an autogenerated mock type for the WriteCloseFlusher type 8 type WriteCloseFlusher struct { 9 mock.Mock 10 } 11 12 // Close provides a mock function with given fields: 13 func (_m *WriteCloseFlusher) Close() error { 14 ret := _m.Called() 15 16 var r0 error 17 if rf, ok := ret.Get(0).(func() error); ok { 18 r0 = rf() 19 } else { 20 r0 = ret.Error(0) 21 } 22 23 return r0 24 } 25 26 // Flush provides a mock function with given fields: 27 func (_m *WriteCloseFlusher) Flush() error { 28 ret := _m.Called() 29 30 var r0 error 31 if rf, ok := ret.Get(0).(func() error); ok { 32 r0 = rf() 33 } else { 34 r0 = ret.Error(0) 35 } 36 37 return r0 38 } 39 40 // Write provides a mock function with given fields: p 41 func (_m *WriteCloseFlusher) Write(p []byte) (int, error) { 42 ret := _m.Called(p) 43 44 var r0 int 45 var r1 error 46 if rf, ok := ret.Get(0).(func([]byte) (int, error)); ok { 47 return rf(p) 48 } 49 if rf, ok := ret.Get(0).(func([]byte) int); ok { 50 r0 = rf(p) 51 } else { 52 r0 = ret.Get(0).(int) 53 } 54 55 if rf, ok := ret.Get(1).(func([]byte) error); ok { 56 r1 = rf(p) 57 } else { 58 r1 = ret.Error(1) 59 } 60 61 return r0, r1 62 } 63 64 type mockConstructorTestingTNewWriteCloseFlusher interface { 65 mock.TestingT 66 Cleanup(func()) 67 } 68 69 // NewWriteCloseFlusher creates a new instance of WriteCloseFlusher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 70 func NewWriteCloseFlusher(t mockConstructorTestingTNewWriteCloseFlusher) *WriteCloseFlusher { 71 mock := &WriteCloseFlusher{} 72 mock.Mock.Test(t) 73 74 t.Cleanup(func() { mock.AssertExpectations(t) }) 75 76 return mock 77 }