ussd/internal/testutil/mocks/servicemock.go

55 lines
2.0 KiB
Go
Raw Permalink Normal View History

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
}
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-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)
}
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)
}
func (m *MockAccountService) VoucherData(ctx context.Context, address string) (*models.VoucherDataResult, error) {
args := m.Called(address)
return args.Get(0).(*models.VoucherDataResult), args.Error(1)
}
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)
}
func (m *MockAccountService) CheckAliasAddress(ctx context.Context, alias string) (*dataserviceapi.AliasAddress, error) {
2024-12-03 11:31:30 +01:00
args := m.Called(alias)
return args.Get(0).(*dataserviceapi.AliasAddress), args.Error(1)
}