2024-09-07 08:55:00 +02:00
|
|
|
package mocks
|
|
|
|
|
|
|
|
import (
|
2024-10-23 11:45:54 +02:00
|
|
|
"context"
|
|
|
|
|
2024-11-03 02:44:57 +01:00
|
|
|
"git.grassecon.net/urdt/ussd/models"
|
2024-10-31 02:28:37 +01:00
|
|
|
dataserviceapi "github.com/grassrootseconomics/ussd-data-service/pkg/api"
|
2024-09-07 08:55:00 +02:00
|
|
|
"github.com/stretchr/testify/mock"
|
|
|
|
)
|
|
|
|
|
|
|
|
// MockAccountService implements AccountServiceInterface for testing
|
|
|
|
type MockAccountService struct {
|
|
|
|
mock.Mock
|
|
|
|
}
|
|
|
|
|
2024-10-31 02:28:37 +01:00
|
|
|
func (m *MockAccountService) CreateAccount(ctx context.Context) (*models.AccountResult, error) {
|
2024-09-07 08:55:00 +02:00
|
|
|
args := m.Called()
|
2024-10-31 02:28:37 +01:00
|
|
|
return args.Get(0).(*models.AccountResult), args.Error(1)
|
2024-09-07 08:55:00 +02:00
|
|
|
}
|
|
|
|
|
2024-10-31 02:28:37 +01:00
|
|
|
func (m *MockAccountService) CheckBalance(ctx context.Context, publicKey string) (*models.BalanceResult, error) {
|
2024-09-07 08:55:00 +02:00
|
|
|
args := m.Called(publicKey)
|
2024-10-31 02:28:37 +01:00
|
|
|
return args.Get(0).(*models.BalanceResult), args.Error(1)
|
2024-09-07 08:55:00 +02:00
|
|
|
}
|
|
|
|
|
2024-10-31 13:15:07 +01:00
|
|
|
func (m *MockAccountService) TrackAccountStatus(ctx context.Context, trackingId string) (*models.TrackStatusResult, error) {
|
2024-09-07 08:55:00 +02:00
|
|
|
args := m.Called(trackingId)
|
2024-10-31 02:28:37 +01:00
|
|
|
return args.Get(0).(*models.TrackStatusResult), args.Error(1)
|
2024-10-18 16:04:02 +02:00
|
|
|
}
|
2024-10-24 19:39:43 +02:00
|
|
|
|
2024-10-31 02:28:37 +01:00
|
|
|
func (m *MockAccountService) FetchVouchers(ctx context.Context, publicKey string) ([]dataserviceapi.TokenHoldings, error) {
|
2024-10-12 17:03:13 +02:00
|
|
|
args := m.Called(publicKey)
|
2024-10-31 02:28:37 +01:00
|
|
|
return args.Get(0).([]dataserviceapi.TokenHoldings), args.Error(1)
|
2024-09-28 13:07:37 +02:00
|
|
|
}
|
2024-11-02 17:42:50 +01:00
|
|
|
|
|
|
|
func (m *MockAccountService) FetchTransactions(ctx context.Context, publicKey string) ([]dataserviceapi.Last10TxResponse, error) {
|
|
|
|
args := m.Called(publicKey)
|
|
|
|
return args.Get(0).([]dataserviceapi.Last10TxResponse), args.Error(1)
|
|
|
|
}
|
2024-11-04 03:23:30 +01:00
|
|
|
|
2024-11-14 18:02:48 +01:00
|
|
|
func (m *MockAccountService) VoucherData(ctx context.Context, address string) (*models.VoucherDataResult, error) {
|
2024-11-04 03:23:30 +01:00
|
|
|
args := m.Called(address)
|
|
|
|
return args.Get(0).(*models.VoucherDataResult), args.Error(1)
|
|
|
|
}
|
2024-11-14 18:02:48 +01:00
|
|
|
|
|
|
|
func (m *MockAccountService) TokenTransfer(ctx context.Context, amount, from, to, tokenAddress string) (*models.TokenTransferResponse, error) {
|
|
|
|
args := m.Called()
|
|
|
|
return args.Get(0).(*models.TokenTransferResponse), args.Error(1)
|
|
|
|
}
|