github.com/yandex/pandora@v0.5.32/lib/ioutil2/mocks/write_closer.go (about) 1 // Code generated by mockery v2.20.2. DO NOT EDIT. 2 3 package iomock 4 5 import mock "github.com/stretchr/testify/mock" 6 7 // WriteCloser is an autogenerated mock type for the WriteCloser type 8 type WriteCloser struct { 9 mock.Mock 10 } 11 12 // Close provides a mock function with given fields: 13 func (_m *WriteCloser) 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 // Write provides a mock function with given fields: p 27 func (_m *WriteCloser) Write(p []byte) (int, error) { 28 ret := _m.Called(p) 29 30 var r0 int 31 var r1 error 32 if rf, ok := ret.Get(0).(func([]byte) (int, error)); ok { 33 return rf(p) 34 } 35 if rf, ok := ret.Get(0).(func([]byte) int); ok { 36 r0 = rf(p) 37 } else { 38 r0 = ret.Get(0).(int) 39 } 40 41 if rf, ok := ret.Get(1).(func([]byte) error); ok { 42 r1 = rf(p) 43 } else { 44 r1 = ret.Error(1) 45 } 46 47 return r0, r1 48 } 49 50 type mockConstructorTestingTNewWriteCloser interface { 51 mock.TestingT 52 Cleanup(func()) 53 } 54 55 // NewWriteCloser creates a new instance of WriteCloser. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 56 func NewWriteCloser(t mockConstructorTestingTNewWriteCloser) *WriteCloser { 57 mock := &WriteCloser{} 58 mock.Mock.Test(t) 59 60 t.Cleanup(func() { mock.AssertExpectations(t) }) 61 62 return mock 63 }