github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/mocknetwork/codec.go (about)

     1  // Code generated by mockery v2.21.4. DO NOT EDIT.
     2  
     3  package mocknetwork
     4  
     5  import (
     6  	io "io"
     7  
     8  	network "github.com/onflow/flow-go/network"
     9  	mock "github.com/stretchr/testify/mock"
    10  )
    11  
    12  // Codec is an autogenerated mock type for the Codec type
    13  type Codec struct {
    14  	mock.Mock
    15  }
    16  
    17  // Decode provides a mock function with given fields: data
    18  func (_m *Codec) Decode(data []byte) (interface{}, error) {
    19  	ret := _m.Called(data)
    20  
    21  	var r0 interface{}
    22  	var r1 error
    23  	if rf, ok := ret.Get(0).(func([]byte) (interface{}, error)); ok {
    24  		return rf(data)
    25  	}
    26  	if rf, ok := ret.Get(0).(func([]byte) interface{}); ok {
    27  		r0 = rf(data)
    28  	} else {
    29  		if ret.Get(0) != nil {
    30  			r0 = ret.Get(0).(interface{})
    31  		}
    32  	}
    33  
    34  	if rf, ok := ret.Get(1).(func([]byte) error); ok {
    35  		r1 = rf(data)
    36  	} else {
    37  		r1 = ret.Error(1)
    38  	}
    39  
    40  	return r0, r1
    41  }
    42  
    43  // Encode provides a mock function with given fields: v
    44  func (_m *Codec) Encode(v interface{}) ([]byte, error) {
    45  	ret := _m.Called(v)
    46  
    47  	var r0 []byte
    48  	var r1 error
    49  	if rf, ok := ret.Get(0).(func(interface{}) ([]byte, error)); ok {
    50  		return rf(v)
    51  	}
    52  	if rf, ok := ret.Get(0).(func(interface{}) []byte); ok {
    53  		r0 = rf(v)
    54  	} else {
    55  		if ret.Get(0) != nil {
    56  			r0 = ret.Get(0).([]byte)
    57  		}
    58  	}
    59  
    60  	if rf, ok := ret.Get(1).(func(interface{}) error); ok {
    61  		r1 = rf(v)
    62  	} else {
    63  		r1 = ret.Error(1)
    64  	}
    65  
    66  	return r0, r1
    67  }
    68  
    69  // NewDecoder provides a mock function with given fields: r
    70  func (_m *Codec) NewDecoder(r io.Reader) network.Decoder {
    71  	ret := _m.Called(r)
    72  
    73  	var r0 network.Decoder
    74  	if rf, ok := ret.Get(0).(func(io.Reader) network.Decoder); ok {
    75  		r0 = rf(r)
    76  	} else {
    77  		if ret.Get(0) != nil {
    78  			r0 = ret.Get(0).(network.Decoder)
    79  		}
    80  	}
    81  
    82  	return r0
    83  }
    84  
    85  // NewEncoder provides a mock function with given fields: w
    86  func (_m *Codec) NewEncoder(w io.Writer) network.Encoder {
    87  	ret := _m.Called(w)
    88  
    89  	var r0 network.Encoder
    90  	if rf, ok := ret.Get(0).(func(io.Writer) network.Encoder); ok {
    91  		r0 = rf(w)
    92  	} else {
    93  		if ret.Get(0) != nil {
    94  			r0 = ret.Get(0).(network.Encoder)
    95  		}
    96  	}
    97  
    98  	return r0
    99  }
   100  
   101  type mockConstructorTestingTNewCodec interface {
   102  	mock.TestingT
   103  	Cleanup(func())
   104  }
   105  
   106  // NewCodec creates a new instance of Codec. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   107  func NewCodec(t mockConstructorTestingTNewCodec) *Codec {
   108  	mock := &Codec{}
   109  	mock.Mock.Test(t)
   110  
   111  	t.Cleanup(func() { mock.AssertExpectations(t) })
   112  
   113  	return mock
   114  }