| /* |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * https://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| */ |
| |
| // Code generated by mockery v2.42.2. DO NOT EDIT. |
| |
| package bacnetip |
| |
| import mock "github.com/stretchr/testify/mock" |
| |
| // MockPDUData is an autogenerated mock type for the PDUData type |
| type MockPDUData struct { |
| mock.Mock |
| } |
| |
| type MockPDUData_Expecter struct { |
| mock *mock.Mock |
| } |
| |
| func (_m *MockPDUData) EXPECT() *MockPDUData_Expecter { |
| return &MockPDUData_Expecter{mock: &_m.Mock} |
| } |
| |
| // Get provides a mock function with given fields: |
| func (_m *MockPDUData) Get() (byte, error) { |
| ret := _m.Called() |
| |
| if len(ret) == 0 { |
| panic("no return value specified for Get") |
| } |
| |
| var r0 byte |
| var r1 error |
| if rf, ok := ret.Get(0).(func() (byte, error)); ok { |
| return rf() |
| } |
| if rf, ok := ret.Get(0).(func() byte); ok { |
| r0 = rf() |
| } else { |
| r0 = ret.Get(0).(byte) |
| } |
| |
| if rf, ok := ret.Get(1).(func() error); ok { |
| r1 = rf() |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // MockPDUData_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' |
| type MockPDUData_Get_Call struct { |
| *mock.Call |
| } |
| |
| // Get is a helper method to define mock.On call |
| func (_e *MockPDUData_Expecter) Get() *MockPDUData_Get_Call { |
| return &MockPDUData_Get_Call{Call: _e.mock.On("Get")} |
| } |
| |
| func (_c *MockPDUData_Get_Call) Run(run func()) *MockPDUData_Get_Call { |
| _c.Call.Run(func(args mock.Arguments) { |
| run() |
| }) |
| return _c |
| } |
| |
| func (_c *MockPDUData_Get_Call) Return(_a0 byte, _a1 error) *MockPDUData_Get_Call { |
| _c.Call.Return(_a0, _a1) |
| return _c |
| } |
| |
| func (_c *MockPDUData_Get_Call) RunAndReturn(run func() (byte, error)) *MockPDUData_Get_Call { |
| _c.Call.Return(run) |
| return _c |
| } |
| |
| // GetData provides a mock function with given fields: dlen |
| func (_m *MockPDUData) GetData(dlen int) ([]byte, error) { |
| ret := _m.Called(dlen) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for GetData") |
| } |
| |
| var r0 []byte |
| var r1 error |
| if rf, ok := ret.Get(0).(func(int) ([]byte, error)); ok { |
| return rf(dlen) |
| } |
| if rf, ok := ret.Get(0).(func(int) []byte); ok { |
| r0 = rf(dlen) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).([]byte) |
| } |
| } |
| |
| if rf, ok := ret.Get(1).(func(int) error); ok { |
| r1 = rf(dlen) |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // MockPDUData_GetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetData' |
| type MockPDUData_GetData_Call struct { |
| *mock.Call |
| } |
| |
| // GetData is a helper method to define mock.On call |
| // - dlen int |
| func (_e *MockPDUData_Expecter) GetData(dlen interface{}) *MockPDUData_GetData_Call { |
| return &MockPDUData_GetData_Call{Call: _e.mock.On("GetData", dlen)} |
| } |
| |
| func (_c *MockPDUData_GetData_Call) Run(run func(dlen int)) *MockPDUData_GetData_Call { |
| _c.Call.Run(func(args mock.Arguments) { |
| run(args[0].(int)) |
| }) |
| return _c |
| } |
| |
| func (_c *MockPDUData_GetData_Call) Return(_a0 []byte, _a1 error) *MockPDUData_GetData_Call { |
| _c.Call.Return(_a0, _a1) |
| return _c |
| } |
| |
| func (_c *MockPDUData_GetData_Call) RunAndReturn(run func(int) ([]byte, error)) *MockPDUData_GetData_Call { |
| _c.Call.Return(run) |
| return _c |
| } |
| |
| // GetLong provides a mock function with given fields: |
| func (_m *MockPDUData) GetLong() (int64, error) { |
| ret := _m.Called() |
| |
| if len(ret) == 0 { |
| panic("no return value specified for GetLong") |
| } |
| |
| var r0 int64 |
| var r1 error |
| if rf, ok := ret.Get(0).(func() (int64, error)); ok { |
| return rf() |
| } |
| if rf, ok := ret.Get(0).(func() int64); ok { |
| r0 = rf() |
| } else { |
| r0 = ret.Get(0).(int64) |
| } |
| |
| if rf, ok := ret.Get(1).(func() error); ok { |
| r1 = rf() |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // MockPDUData_GetLong_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLong' |
| type MockPDUData_GetLong_Call struct { |
| *mock.Call |
| } |
| |
| // GetLong is a helper method to define mock.On call |
| func (_e *MockPDUData_Expecter) GetLong() *MockPDUData_GetLong_Call { |
| return &MockPDUData_GetLong_Call{Call: _e.mock.On("GetLong")} |
| } |
| |
| func (_c *MockPDUData_GetLong_Call) Run(run func()) *MockPDUData_GetLong_Call { |
| _c.Call.Run(func(args mock.Arguments) { |
| run() |
| }) |
| return _c |
| } |
| |
| func (_c *MockPDUData_GetLong_Call) Return(_a0 int64, _a1 error) *MockPDUData_GetLong_Call { |
| _c.Call.Return(_a0, _a1) |
| return _c |
| } |
| |
| func (_c *MockPDUData_GetLong_Call) RunAndReturn(run func() (int64, error)) *MockPDUData_GetLong_Call { |
| _c.Call.Return(run) |
| return _c |
| } |
| |
| // GetPduData provides a mock function with given fields: |
| func (_m *MockPDUData) GetPduData() []byte { |
| ret := _m.Called() |
| |
| if len(ret) == 0 { |
| panic("no return value specified for GetPduData") |
| } |
| |
| var r0 []byte |
| if rf, ok := ret.Get(0).(func() []byte); ok { |
| r0 = rf() |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).([]byte) |
| } |
| } |
| |
| return r0 |
| } |
| |
| // MockPDUData_GetPduData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPduData' |
| type MockPDUData_GetPduData_Call struct { |
| *mock.Call |
| } |
| |
| // GetPduData is a helper method to define mock.On call |
| func (_e *MockPDUData_Expecter) GetPduData() *MockPDUData_GetPduData_Call { |
| return &MockPDUData_GetPduData_Call{Call: _e.mock.On("GetPduData")} |
| } |
| |
| func (_c *MockPDUData_GetPduData_Call) Run(run func()) *MockPDUData_GetPduData_Call { |
| _c.Call.Run(func(args mock.Arguments) { |
| run() |
| }) |
| return _c |
| } |
| |
| func (_c *MockPDUData_GetPduData_Call) Return(_a0 []byte) *MockPDUData_GetPduData_Call { |
| _c.Call.Return(_a0) |
| return _c |
| } |
| |
| func (_c *MockPDUData_GetPduData_Call) RunAndReturn(run func() []byte) *MockPDUData_GetPduData_Call { |
| _c.Call.Return(run) |
| return _c |
| } |
| |
| // GetShort provides a mock function with given fields: |
| func (_m *MockPDUData) GetShort() (int16, error) { |
| ret := _m.Called() |
| |
| if len(ret) == 0 { |
| panic("no return value specified for GetShort") |
| } |
| |
| var r0 int16 |
| var r1 error |
| if rf, ok := ret.Get(0).(func() (int16, error)); ok { |
| return rf() |
| } |
| if rf, ok := ret.Get(0).(func() int16); ok { |
| r0 = rf() |
| } else { |
| r0 = ret.Get(0).(int16) |
| } |
| |
| if rf, ok := ret.Get(1).(func() error); ok { |
| r1 = rf() |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // MockPDUData_GetShort_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetShort' |
| type MockPDUData_GetShort_Call struct { |
| *mock.Call |
| } |
| |
| // GetShort is a helper method to define mock.On call |
| func (_e *MockPDUData_Expecter) GetShort() *MockPDUData_GetShort_Call { |
| return &MockPDUData_GetShort_Call{Call: _e.mock.On("GetShort")} |
| } |
| |
| func (_c *MockPDUData_GetShort_Call) Run(run func()) *MockPDUData_GetShort_Call { |
| _c.Call.Run(func(args mock.Arguments) { |
| run() |
| }) |
| return _c |
| } |
| |
| func (_c *MockPDUData_GetShort_Call) Return(_a0 int16, _a1 error) *MockPDUData_GetShort_Call { |
| _c.Call.Return(_a0, _a1) |
| return _c |
| } |
| |
| func (_c *MockPDUData_GetShort_Call) RunAndReturn(run func() (int16, error)) *MockPDUData_GetShort_Call { |
| _c.Call.Return(run) |
| return _c |
| } |
| |
| // Put provides a mock function with given fields: _a0 |
| func (_m *MockPDUData) Put(_a0 byte) { |
| _m.Called(_a0) |
| } |
| |
| // MockPDUData_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' |
| type MockPDUData_Put_Call struct { |
| *mock.Call |
| } |
| |
| // Put is a helper method to define mock.On call |
| // - _a0 byte |
| func (_e *MockPDUData_Expecter) Put(_a0 interface{}) *MockPDUData_Put_Call { |
| return &MockPDUData_Put_Call{Call: _e.mock.On("Put", _a0)} |
| } |
| |
| func (_c *MockPDUData_Put_Call) Run(run func(_a0 byte)) *MockPDUData_Put_Call { |
| _c.Call.Run(func(args mock.Arguments) { |
| run(args[0].(byte)) |
| }) |
| return _c |
| } |
| |
| func (_c *MockPDUData_Put_Call) Return() *MockPDUData_Put_Call { |
| _c.Call.Return() |
| return _c |
| } |
| |
| func (_c *MockPDUData_Put_Call) RunAndReturn(run func(byte)) *MockPDUData_Put_Call { |
| _c.Call.Return(run) |
| return _c |
| } |
| |
| // PutData provides a mock function with given fields: _a0 |
| func (_m *MockPDUData) PutData(_a0 ...byte) { |
| _va := make([]interface{}, len(_a0)) |
| for _i := range _a0 { |
| _va[_i] = _a0[_i] |
| } |
| var _ca []interface{} |
| _ca = append(_ca, _va...) |
| _m.Called(_ca...) |
| } |
| |
| // MockPDUData_PutData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutData' |
| type MockPDUData_PutData_Call struct { |
| *mock.Call |
| } |
| |
| // PutData is a helper method to define mock.On call |
| // - _a0 ...byte |
| func (_e *MockPDUData_Expecter) PutData(_a0 ...interface{}) *MockPDUData_PutData_Call { |
| return &MockPDUData_PutData_Call{Call: _e.mock.On("PutData", |
| append([]interface{}{}, _a0...)...)} |
| } |
| |
| func (_c *MockPDUData_PutData_Call) Run(run func(_a0 ...byte)) *MockPDUData_PutData_Call { |
| _c.Call.Run(func(args mock.Arguments) { |
| variadicArgs := make([]byte, len(args)-0) |
| for i, a := range args[0:] { |
| if a != nil { |
| variadicArgs[i] = a.(byte) |
| } |
| } |
| run(variadicArgs...) |
| }) |
| return _c |
| } |
| |
| func (_c *MockPDUData_PutData_Call) Return() *MockPDUData_PutData_Call { |
| _c.Call.Return() |
| return _c |
| } |
| |
| func (_c *MockPDUData_PutData_Call) RunAndReturn(run func(...byte)) *MockPDUData_PutData_Call { |
| _c.Call.Return(run) |
| return _c |
| } |
| |
| // PutLong provides a mock function with given fields: _a0 |
| func (_m *MockPDUData) PutLong(_a0 int64) { |
| _m.Called(_a0) |
| } |
| |
| // MockPDUData_PutLong_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutLong' |
| type MockPDUData_PutLong_Call struct { |
| *mock.Call |
| } |
| |
| // PutLong is a helper method to define mock.On call |
| // - _a0 int64 |
| func (_e *MockPDUData_Expecter) PutLong(_a0 interface{}) *MockPDUData_PutLong_Call { |
| return &MockPDUData_PutLong_Call{Call: _e.mock.On("PutLong", _a0)} |
| } |
| |
| func (_c *MockPDUData_PutLong_Call) Run(run func(_a0 int64)) *MockPDUData_PutLong_Call { |
| _c.Call.Run(func(args mock.Arguments) { |
| run(args[0].(int64)) |
| }) |
| return _c |
| } |
| |
| func (_c *MockPDUData_PutLong_Call) Return() *MockPDUData_PutLong_Call { |
| _c.Call.Return() |
| return _c |
| } |
| |
| func (_c *MockPDUData_PutLong_Call) RunAndReturn(run func(int64)) *MockPDUData_PutLong_Call { |
| _c.Call.Return(run) |
| return _c |
| } |
| |
| // PutShort provides a mock function with given fields: _a0 |
| func (_m *MockPDUData) PutShort(_a0 int16) { |
| _m.Called(_a0) |
| } |
| |
| // MockPDUData_PutShort_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutShort' |
| type MockPDUData_PutShort_Call struct { |
| *mock.Call |
| } |
| |
| // PutShort is a helper method to define mock.On call |
| // - _a0 int16 |
| func (_e *MockPDUData_Expecter) PutShort(_a0 interface{}) *MockPDUData_PutShort_Call { |
| return &MockPDUData_PutShort_Call{Call: _e.mock.On("PutShort", _a0)} |
| } |
| |
| func (_c *MockPDUData_PutShort_Call) Run(run func(_a0 int16)) *MockPDUData_PutShort_Call { |
| _c.Call.Run(func(args mock.Arguments) { |
| run(args[0].(int16)) |
| }) |
| return _c |
| } |
| |
| func (_c *MockPDUData_PutShort_Call) Return() *MockPDUData_PutShort_Call { |
| _c.Call.Return() |
| return _c |
| } |
| |
| func (_c *MockPDUData_PutShort_Call) RunAndReturn(run func(int16)) *MockPDUData_PutShort_Call { |
| _c.Call.Return(run) |
| return _c |
| } |
| |
| // SetPduData provides a mock function with given fields: _a0 |
| func (_m *MockPDUData) SetPduData(_a0 []byte) { |
| _m.Called(_a0) |
| } |
| |
| // MockPDUData_SetPduData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPduData' |
| type MockPDUData_SetPduData_Call struct { |
| *mock.Call |
| } |
| |
| // SetPduData is a helper method to define mock.On call |
| // - _a0 []byte |
| func (_e *MockPDUData_Expecter) SetPduData(_a0 interface{}) *MockPDUData_SetPduData_Call { |
| return &MockPDUData_SetPduData_Call{Call: _e.mock.On("SetPduData", _a0)} |
| } |
| |
| func (_c *MockPDUData_SetPduData_Call) Run(run func(_a0 []byte)) *MockPDUData_SetPduData_Call { |
| _c.Call.Run(func(args mock.Arguments) { |
| run(args[0].([]byte)) |
| }) |
| return _c |
| } |
| |
| func (_c *MockPDUData_SetPduData_Call) Return() *MockPDUData_SetPduData_Call { |
| _c.Call.Return() |
| return _c |
| } |
| |
| func (_c *MockPDUData_SetPduData_Call) RunAndReturn(run func([]byte)) *MockPDUData_SetPduData_Call { |
| _c.Call.Return(run) |
| return _c |
| } |
| |
| // NewMockPDUData creates a new instance of MockPDUData. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. |
| // The first argument is typically a *testing.T value. |
| func NewMockPDUData(t interface { |
| mock.TestingT |
| Cleanup(func()) |
| }) *MockPDUData { |
| mock := &MockPDUData{} |
| mock.Mock.Test(t) |
| |
| t.Cleanup(func() { mock.AssertExpectations(t) }) |
| |
| return mock |
| } |