mock_test

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigServiceMock

type ConfigServiceMock struct {
	mock.Mock
}

func (*ConfigServiceMock) GetRoomsConfig

func (m *ConfigServiceMock) GetRoomsConfig() (model.Dictionary, error)

func (*ConfigServiceMock) GetServerStatus

func (m *ConfigServiceMock) GetServerStatus() (*model.ServerStatus, error)

func (*ConfigServiceMock) SetMqttStatus

func (m *ConfigServiceMock) SetMqttStatus(connectionStatus int)

func (*ConfigServiceMock) SetWebsocketStatus

func (m *ConfigServiceMock) SetWebsocketStatus(connected bool)

type ConfigurationMock

type ConfigurationMock struct {
	mock.Mock
}

func (*ConfigurationMock) GetBool

func (m *ConfigurationMock) GetBool(key config.ConfigKey, defaultValue bool) bool

func (*ConfigurationMock) GetInt

func (m *ConfigurationMock) GetInt(key config.ConfigKey, defaultValue int) int

func (*ConfigurationMock) GetList

func (m *ConfigurationMock) GetList(key config.ConfigKey) []interface{}

func (*ConfigurationMock) GetMap

func (m *ConfigurationMock) GetMap(key config.ConfigKey) map[interface{}]interface{}

func (*ConfigurationMock) GetStr

func (m *ConfigurationMock) GetStr(key config.ConfigKey, defaultValue string) string

func (*ConfigurationMock) ReadConfiguration

func (m *ConfigurationMock) ReadConfiguration(configFile string)

type ConfigurationRepoMock

type ConfigurationRepoMock struct {
	mock.Mock
}

func (*ConfigurationRepoMock) GetBool

func (m *ConfigurationRepoMock) GetBool(key config.ConfigKey, defaultValue bool) bool

func (*ConfigurationRepoMock) GetInt

func (m *ConfigurationRepoMock) GetInt(key config.ConfigKey, defaultValue int) int

func (*ConfigurationRepoMock) GetList

func (m *ConfigurationRepoMock) GetList(key config.ConfigKey) []interface{}

func (*ConfigurationRepoMock) GetMap

func (m *ConfigurationRepoMock) GetMap(key config.ConfigKey) map[interface{}]interface{}

func (*ConfigurationRepoMock) GetStr

func (m *ConfigurationRepoMock) GetStr(key config.ConfigKey, defaultValue string) string

func (*ConfigurationRepoMock) ReadConfiguration

func (m *ConfigurationRepoMock) ReadConfiguration(configFile string)

type DeviceRepoMock

type DeviceRepoMock struct {
	mock.Mock
}

func (*DeviceRepoMock) GetDevice

func (m *DeviceRepoMock) GetDevice(deviceKey string) (*model.Device, error)

func (*DeviceRepoMock) GetDevices

func (m *DeviceRepoMock) GetDevices() (*model.Devices, error)

func (*DeviceRepoMock) ReloadDevices

func (m *DeviceRepoMock) ReloadDevices() error

type DeviceServiceMock

type DeviceServiceMock struct {
	mock.Mock
}

func (*DeviceServiceMock) DeviceCommand

func (m *DeviceServiceMock) DeviceCommand(deviceKey string, params model.Dictionary) bool

func (*DeviceServiceMock) DeviceState

func (m *DeviceServiceMock) DeviceState(deviceKey string) interface{}

func (*DeviceServiceMock) DeviceStates

func (m *DeviceServiceMock) DeviceStates() model.Dictionary

func (*DeviceServiceMock) DeviceUpdate

func (m *DeviceServiceMock) DeviceUpdate(dev *model.Device, oldState string)

func (*DeviceServiceMock) GetDevice

func (m *DeviceServiceMock) GetDevice(deviceKey string) (*model.Device, error)

func (*DeviceServiceMock) GetDevices

func (m *DeviceServiceMock) GetDevices() (*model.Devices, error)

func (*DeviceServiceMock) GetDevicesDto

func (m *DeviceServiceMock) GetDevicesDto(filter model.DeviceFilter) (*model.DevicesDto, error)

func (*DeviceServiceMock) ReloadDevices

func (m *DeviceServiceMock) ReloadDevices() error

type MqttClientMock

type MqttClientMock struct {
	mock.Mock
}

func (*MqttClientMock) AddRoute

func (m *MqttClientMock) AddRoute(topic string, callback mqtt.MessageHandler)

func (*MqttClientMock) Connect

func (m *MqttClientMock) Connect() mqtt.Token

func (*MqttClientMock) Disconnect

func (m *MqttClientMock) Disconnect(quiesce uint)

func (*MqttClientMock) IsConnected

func (m *MqttClientMock) IsConnected() bool

func (*MqttClientMock) IsConnectionOpen

func (m *MqttClientMock) IsConnectionOpen() bool

func (*MqttClientMock) OptionsReader

func (m *MqttClientMock) OptionsReader() mqtt.ClientOptionsReader

func (*MqttClientMock) Publish

func (m *MqttClientMock) Publish(topic string, qos byte, retained bool, payload interface{}) mqtt.Token

func (*MqttClientMock) Subscribe

func (m *MqttClientMock) Subscribe(topic string, qos byte, callback mqtt.MessageHandler) mqtt.Token

func (*MqttClientMock) SubscribeMultiple

func (m *MqttClientMock) SubscribeMultiple(filters map[string]byte, callback mqtt.MessageHandler) mqtt.Token

func (*MqttClientMock) Unsubscribe

func (m *MqttClientMock) Unsubscribe(topics ...string) mqtt.Token

type MqttServiceMock

type MqttServiceMock struct {
	mock.Mock
}

func (*MqttServiceMock) HandleMessage

func (m *MqttServiceMock) HandleMessage(topic string, payload []byte)

func (*MqttServiceMock) Publish

func (m *MqttServiceMock) Publish(topic string, payload interface{}) bool

func (*MqttServiceMock) SetClient

func (m *MqttServiceMock) SetClient(client mqtt.Client)

func (*MqttServiceMock) SetMessageHandler

func (m *MqttServiceMock) SetMessageHandler(handler model.MqttMessageHandler)

func (*MqttServiceMock) Subscribe

func (m *MqttServiceMock) Subscribe(topic string) bool

type MqttTokenMock

type MqttTokenMock struct {
	mock.Mock
}

func (*MqttTokenMock) Done

func (m *MqttTokenMock) Done() <-chan struct{}

func (*MqttTokenMock) Error

func (m *MqttTokenMock) Error() error

func (*MqttTokenMock) Wait

func (m *MqttTokenMock) Wait() bool

func (*MqttTokenMock) WaitTimeout

func (m *MqttTokenMock) WaitTimeout(duration time.Duration) bool

type NotificationRepoMock

type NotificationRepoMock struct {
	mock.Mock
}

func (*NotificationRepoMock) GetAllNotifications

func (m *NotificationRepoMock) GetAllNotifications() (*model.Notifications, error)

func (*NotificationRepoMock) GetNotifications

func (m *NotificationRepoMock) GetNotifications(deviceKey string, key string) ([]*model.Notification, error)

func (*NotificationRepoMock) ReloadNotifications

func (m *NotificationRepoMock) ReloadNotifications() error

type NotificationServiceMock

type NotificationServiceMock struct {
	mock.Mock
}

func (*NotificationServiceMock) GetNotifications

func (m *NotificationServiceMock) GetNotifications(deviceKey string, key string) ([]*model.Notification, error)

func (*NotificationServiceMock) ReloadNotifications

func (m *NotificationServiceMock) ReloadNotifications() error

type RestServiceMock

type RestServiceMock struct {
	mock.Mock
}

func (*RestServiceMock) GetRequest

func (m *RestServiceMock) GetRequest(url string, device *model.Device) bool

func (*RestServiceMock) HandleMessage

func (m *RestServiceMock) HandleMessage(device *model.Device, payload string)

func (*RestServiceMock) SetMessageHandler

func (m *RestServiceMock) SetMessageHandler(handler model.RestMessageHandler)

type ServiceFactoryMock

type ServiceFactoryMock struct {
	mock.Mock
}

func (*ServiceFactoryMock) Finalize

func (m *ServiceFactoryMock) Finalize()

func (*ServiceFactoryMock) GetConfigService

func (m *ServiceFactoryMock) GetConfigService() model.IConfigService

func (*ServiceFactoryMock) GetDeviceService

func (m *ServiceFactoryMock) GetDeviceService() model.IDeviceService

func (*ServiceFactoryMock) GetMqttService

func (m *ServiceFactoryMock) GetMqttService() model.IMqttService

func (*ServiceFactoryMock) GetNotificationService

func (m *ServiceFactoryMock) GetNotificationService() model.INotificationService

func (*ServiceFactoryMock) GetRestService

func (m *ServiceFactoryMock) GetRestService() model.IRestService

func (*ServiceFactoryMock) GetSharedMemory

func (m *ServiceFactoryMock) GetSharedMemory() model.ISharedMemory

func (*ServiceFactoryMock) GetTelegramService

func (m *ServiceFactoryMock) GetTelegramService() model.ITelegramService

func (*ServiceFactoryMock) GetUserService

func (m *ServiceFactoryMock) GetUserService() model.IUserService

type SharedMemoryMock

type SharedMemoryMock struct {
	mock.Mock
}

func (*SharedMemoryMock) FinalizeSharedMem

func (m *SharedMemoryMock) FinalizeSharedMem()

func (*SharedMemoryMock) GetDeviceMem

func (m *SharedMemoryMock) GetDeviceMem(deviceKey string) interface{}

func (*SharedMemoryMock) GetLastUpdated

func (m *SharedMemoryMock) GetLastUpdated(deviceKey string) int64

func (*SharedMemoryMock) GetMem

func (m *SharedMemoryMock) GetMem(deviceKey string, key string) interface{}

func (*SharedMemoryMock) GetMemory

func (m *SharedMemoryMock) GetMemory() model.Dictionary

func (*SharedMemoryMock) LoadSharedMem

func (m *SharedMemoryMock) LoadSharedMem()

func (*SharedMemoryMock) MarkAsUpdated

func (m *SharedMemoryMock) MarkAsUpdated(deviceKey string)

func (*SharedMemoryMock) SetMem

func (m *SharedMemoryMock) SetMem(deviceKey string, key string, value interface{})

func (*SharedMemoryMock) SetNotifyCallback

func (m *SharedMemoryMock) SetNotifyCallback(notifyFunc model.NotifyFunc)

type TelegramBotApiMock

type TelegramBotApiMock struct {
	mock.Mock
}

func (*TelegramBotApiMock) Send

type TelegramServiceMock

type TelegramServiceMock struct {
	mock.Mock
}

func (*TelegramServiceMock) SendMessage

func (m *TelegramServiceMock) SendMessage(message string) bool

type UserRepoMock

type UserRepoMock struct {
	mock.Mock
}

func (*UserRepoMock) FindByUsername

func (m *UserRepoMock) FindByUsername(userName string) (*model.User, error)

func (*UserRepoMock) GetUsers

func (m *UserRepoMock) GetUsers() (*model.Users, error)

func (*UserRepoMock) ReloadUsers

func (m *UserRepoMock) ReloadUsers() error

type UserServiceMock

type UserServiceMock struct {
	mock.Mock
}

func (*UserServiceMock) FindByUsername

func (m *UserServiceMock) FindByUsername(userName string) (*model.User, error)

func (*UserServiceMock) ReloadUsers

func (m *UserServiceMock) ReloadUsers() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL