ussd/internal/testutil/mocks/servicemock.go

41 lines
1.3 KiB
Go
Raw Normal View History

2024-09-07 08:55:00 +02:00
package mocks
import (
2024-10-23 11:45:54 +02:00
"context"
2024-09-07 08:55:00 +02:00
"git.grassecon.net/urdt/ussd/internal/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)
}