Compare commits
4 Commits
eb9f470ac5
...
175cbd1983
Author | SHA1 | Date | |
---|---|---|---|
175cbd1983 | |||
8175d6ac12 | |||
d4bae50ff0 | |||
d7376a4196 |
File diff suppressed because it is too large
Load Diff
60
internal/handlers/ussd/mocks/dbmock.go
Normal file
60
internal/handlers/ussd/mocks/dbmock.go
Normal file
@ -0,0 +1,60 @@
|
||||
package mocks
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.defalsify.org/vise.git/lang"
|
||||
"git.grassecon.net/urdt/ussd/internal/utils"
|
||||
"github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
type MockDb struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
func (m *MockDb) SetPrefix(prefix uint8) {
|
||||
m.Called(utils.DATA_FAMILY_NAME)
|
||||
}
|
||||
|
||||
func (m *MockDb) Prefix() uint8 {
|
||||
args := m.Called()
|
||||
return args.Get(0).(uint8)
|
||||
}
|
||||
|
||||
func (m *MockDb) Safe() bool {
|
||||
args := m.Called()
|
||||
return args.Get(0).(bool)
|
||||
}
|
||||
|
||||
func (m *MockDb) SetLanguage(language *lang.Language) {
|
||||
m.Called(language)
|
||||
}
|
||||
|
||||
func (m *MockDb) SetLock(uint8, bool) error {
|
||||
args := m.Called()
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *MockDb) Connect(ctx context.Context, connectionStr string) error {
|
||||
args := m.Called(ctx, connectionStr)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *MockDb) SetSession(sessionId string) {
|
||||
m.Called(sessionId)
|
||||
}
|
||||
|
||||
func (m *MockDb) Put(ctx context.Context, key, value []byte) error {
|
||||
args := m.Called(ctx, key, value)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *MockDb) Get(ctx context.Context, key []byte) ([]byte, error) {
|
||||
args := m.Called(ctx, key)
|
||||
return nil, args.Error(0)
|
||||
}
|
||||
|
||||
func (m *MockDb) Close() error {
|
||||
args := m.Called(nil)
|
||||
return args.Error(0)
|
||||
}
|
Loading…
Reference in New Issue
Block a user