2022-03-15 15:28:42 +00:00
|
|
|
// Code generated by moq; DO NOT EDIT.
|
|
|
|
// github.com/matryer/moq
|
|
|
|
|
|
|
|
package discover
|
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Ensure, that DiscoverMock does implement Discover.
|
|
|
|
// If this is not the case, regenerate this file with moq.
|
|
|
|
var _ Discover = &DiscoverMock{}
|
|
|
|
|
|
|
|
// DiscoverMock is a mock implementation of Discover.
|
|
|
|
//
|
2023-04-25 10:28:07 +00:00
|
|
|
// func TestSomethingThatUsesDiscover(t *testing.T) {
|
2022-03-15 15:28:42 +00:00
|
|
|
//
|
2023-04-25 10:28:07 +00:00
|
|
|
// // make and configure a mocked Discover
|
|
|
|
// mockedDiscover := &DiscoverMock{
|
|
|
|
// DevicesFunc: func() ([]Device, error) {
|
|
|
|
// panic("mock out the Devices method")
|
|
|
|
// },
|
|
|
|
// HooksFunc: func() ([]Hook, error) {
|
|
|
|
// panic("mock out the Hooks method")
|
|
|
|
// },
|
|
|
|
// MountsFunc: func() ([]Mount, error) {
|
|
|
|
// panic("mock out the Mounts method")
|
|
|
|
// },
|
|
|
|
// }
|
2022-03-15 15:28:42 +00:00
|
|
|
//
|
2023-04-25 10:28:07 +00:00
|
|
|
// // use mockedDiscover in code that requires Discover
|
|
|
|
// // and then make assertions.
|
2022-03-15 15:28:42 +00:00
|
|
|
//
|
2023-04-25 10:28:07 +00:00
|
|
|
// }
|
2022-03-15 15:28:42 +00:00
|
|
|
type DiscoverMock struct {
|
2022-03-10 13:00:24 +00:00
|
|
|
// DevicesFunc mocks the Devices method.
|
|
|
|
DevicesFunc func() ([]Device, error)
|
|
|
|
|
2022-03-15 15:28:42 +00:00
|
|
|
// HooksFunc mocks the Hooks method.
|
|
|
|
HooksFunc func() ([]Hook, error)
|
|
|
|
|
2022-03-09 15:52:50 +00:00
|
|
|
// MountsFunc mocks the Mounts method.
|
|
|
|
MountsFunc func() ([]Mount, error)
|
|
|
|
|
2022-03-15 15:28:42 +00:00
|
|
|
// calls tracks calls to the methods.
|
|
|
|
calls struct {
|
2022-03-10 13:00:24 +00:00
|
|
|
// Devices holds details about calls to the Devices method.
|
|
|
|
Devices []struct {
|
|
|
|
}
|
2022-03-15 15:28:42 +00:00
|
|
|
// Hooks holds details about calls to the Hooks method.
|
|
|
|
Hooks []struct {
|
|
|
|
}
|
2022-03-09 15:52:50 +00:00
|
|
|
// Mounts holds details about calls to the Mounts method.
|
|
|
|
Mounts []struct {
|
|
|
|
}
|
2022-03-15 15:28:42 +00:00
|
|
|
}
|
2022-03-10 13:00:24 +00:00
|
|
|
lockDevices sync.RWMutex
|
|
|
|
lockHooks sync.RWMutex
|
|
|
|
lockMounts sync.RWMutex
|
|
|
|
}
|
|
|
|
|
|
|
|
// Devices calls DevicesFunc.
|
|
|
|
func (mock *DiscoverMock) Devices() ([]Device, error) {
|
|
|
|
callInfo := struct {
|
|
|
|
}{}
|
|
|
|
mock.lockDevices.Lock()
|
|
|
|
mock.calls.Devices = append(mock.calls.Devices, callInfo)
|
|
|
|
mock.lockDevices.Unlock()
|
|
|
|
if mock.DevicesFunc == nil {
|
|
|
|
var (
|
|
|
|
devicesOut []Device
|
|
|
|
errOut error
|
|
|
|
)
|
|
|
|
return devicesOut, errOut
|
|
|
|
}
|
|
|
|
return mock.DevicesFunc()
|
|
|
|
}
|
|
|
|
|
|
|
|
// DevicesCalls gets all the calls that were made to Devices.
|
|
|
|
// Check the length with:
|
2023-04-25 10:28:07 +00:00
|
|
|
//
|
|
|
|
// len(mockedDiscover.DevicesCalls())
|
2022-03-10 13:00:24 +00:00
|
|
|
func (mock *DiscoverMock) DevicesCalls() []struct {
|
|
|
|
} {
|
|
|
|
var calls []struct {
|
|
|
|
}
|
|
|
|
mock.lockDevices.RLock()
|
|
|
|
calls = mock.calls.Devices
|
|
|
|
mock.lockDevices.RUnlock()
|
|
|
|
return calls
|
2022-03-15 15:28:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Hooks calls HooksFunc.
|
|
|
|
func (mock *DiscoverMock) Hooks() ([]Hook, error) {
|
|
|
|
callInfo := struct {
|
|
|
|
}{}
|
|
|
|
mock.lockHooks.Lock()
|
|
|
|
mock.calls.Hooks = append(mock.calls.Hooks, callInfo)
|
|
|
|
mock.lockHooks.Unlock()
|
|
|
|
if mock.HooksFunc == nil {
|
|
|
|
var (
|
|
|
|
hooksOut []Hook
|
|
|
|
errOut error
|
|
|
|
)
|
|
|
|
return hooksOut, errOut
|
|
|
|
}
|
|
|
|
return mock.HooksFunc()
|
|
|
|
}
|
|
|
|
|
|
|
|
// HooksCalls gets all the calls that were made to Hooks.
|
|
|
|
// Check the length with:
|
2023-04-25 10:28:07 +00:00
|
|
|
//
|
|
|
|
// len(mockedDiscover.HooksCalls())
|
2022-03-15 15:28:42 +00:00
|
|
|
func (mock *DiscoverMock) HooksCalls() []struct {
|
|
|
|
} {
|
|
|
|
var calls []struct {
|
|
|
|
}
|
|
|
|
mock.lockHooks.RLock()
|
|
|
|
calls = mock.calls.Hooks
|
|
|
|
mock.lockHooks.RUnlock()
|
|
|
|
return calls
|
|
|
|
}
|
2022-03-09 15:52:50 +00:00
|
|
|
|
|
|
|
// Mounts calls MountsFunc.
|
|
|
|
func (mock *DiscoverMock) Mounts() ([]Mount, error) {
|
|
|
|
callInfo := struct {
|
|
|
|
}{}
|
|
|
|
mock.lockMounts.Lock()
|
|
|
|
mock.calls.Mounts = append(mock.calls.Mounts, callInfo)
|
|
|
|
mock.lockMounts.Unlock()
|
|
|
|
if mock.MountsFunc == nil {
|
|
|
|
var (
|
|
|
|
mountsOut []Mount
|
|
|
|
errOut error
|
|
|
|
)
|
|
|
|
return mountsOut, errOut
|
|
|
|
}
|
|
|
|
return mock.MountsFunc()
|
|
|
|
}
|
|
|
|
|
|
|
|
// MountsCalls gets all the calls that were made to Mounts.
|
|
|
|
// Check the length with:
|
2023-04-25 10:28:07 +00:00
|
|
|
//
|
|
|
|
// len(mockedDiscover.MountsCalls())
|
2022-03-09 15:52:50 +00:00
|
|
|
func (mock *DiscoverMock) MountsCalls() []struct {
|
|
|
|
} {
|
|
|
|
var calls []struct {
|
|
|
|
}
|
|
|
|
mock.lockMounts.RLock()
|
|
|
|
calls = mock.calls.Mounts
|
|
|
|
mock.lockMounts.RUnlock()
|
|
|
|
return calls
|
|
|
|
}
|