Documentation
¶
Overview ¶
Package testutils_test contains utility methods for unit tests.
Index ¶
- func CmdToMessage(cmd tea.Cmd, messages *[]tea.Msg)
- type MockStorage
- func (ms *MockStorage) Close()
- func (ms *MockStorage) Delete(id int) error
- func (ms *MockStorage) Get(hostID int) (host.Host, error)
- func (ms *MockStorage) GetAll() ([]host.Host, error)
- func (ms *MockStorage) Save(m host.Host) (host.Host, error)
- func (ms *MockStorage) Type() constant.HostStorageEnum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MockStorage ¶ added in v1.5.0
func NewMockStorage ¶
func NewMockStorage(shouldFail bool) *MockStorage
NewMockStorage creates a new instance of MockStorage for unit tests. If shouldFail is true, then all operations like Get, Delete, Save will return an error.
func (*MockStorage) Close ¶ added in v1.5.0
func (ms *MockStorage) Close()
func (*MockStorage) Delete ¶ added in v1.5.0
func (ms *MockStorage) Delete(id int) error
Delete implements storage.HostStorage.
func (*MockStorage) Get ¶ added in v1.5.0
func (ms *MockStorage) Get(hostID int) (host.Host, error)
Get implements storage.HostStorage.
func (*MockStorage) GetAll ¶ added in v1.5.0
func (ms *MockStorage) GetAll() ([]host.Host, error)
GetAll implements storage.HostStorage.
func (*MockStorage) Type ¶ added in v1.5.0
func (ms *MockStorage) Type() constant.HostStorageEnum
Click to show internal directories.
Click to hide internal directories.