Documentation ¶
Index ¶
- func CaptureOutput() (*bytes.Buffer, func())
- func NewMockGameResultDAO() *mockGameResultDAO
- type MockQuerier
- func (m *MockQuerier) CheckTransactionID(ctx context.Context, transactionId string) (bool, error)
- func (m *MockQuerier) Close()
- func (m *MockQuerier) GameCount() int
- func (m *MockQuerier) GameResultExists(ctx context.Context, transactionId string) (bool, error)
- func (m *MockQuerier) InsertGameResult(ctx context.Context, txn sqlx.Tx, gameResult entity.GameResult) (int, error)
- func (m *MockQuerier) LockUserRow(ctx context.Context, txn sqlx.Tx, userId uuid.UUID) error
- func (m *MockQuerier) SelectGameResultsByUser(ctx context.Context, userId uuid.UUID, ...) ([]entity.GameResult, error)
- func (m *MockQuerier) SelectUser(ctx context.Context, userId uuid.UUID) (*entity.User, error)
- func (m *MockQuerier) SelectUsersByValidationStatus(ctx context.Context, validationStatus bool) ([]entity.User, error)
- func (m *MockQuerier) UpdateGameResult(ctx context.Context, txn sqlx.Tx, gameResultId int, ...) error
- func (m *MockQuerier) UpdateUserBalance(ctx context.Context, txn sqlx.Tx, userId uuid.UUID, balance float64, ...) error
- func (m *MockQuerier) WithTransaction(ctx context.Context, fn func(*sqlx.Tx) error) (err error)
- type TestDatabase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaptureOutput ¶
CaptureOutput redirects the log output to a buffer and returns a function to restore the original state and the buffer.
func NewMockGameResultDAO ¶
func NewMockGameResultDAO() *mockGameResultDAO
NewMockGameResultDAO creates a new instance of MockManager
Types ¶
type MockQuerier ¶
MockQuerier is a mock type for the Querier type
func NewMockQuerier ¶
func NewMockQuerier() *MockQuerier
NewMockQuerier creates a new instance of MockQuerier
func (*MockQuerier) CheckTransactionID ¶
func (*MockQuerier) Close ¶
func (m *MockQuerier) Close()
func (*MockQuerier) GameCount ¶
func (m *MockQuerier) GameCount() int
func (*MockQuerier) GameResultExists ¶
func (*MockQuerier) InsertGameResult ¶
func (m *MockQuerier) InsertGameResult(ctx context.Context, txn sqlx.Tx, gameResult entity.GameResult) (int, error)
func (*MockQuerier) LockUserRow ¶
func (*MockQuerier) SelectGameResultsByUser ¶
func (m *MockQuerier) SelectGameResultsByUser(ctx context.Context, userId uuid.UUID, validationStatus entity.ValidationStatus) ([]entity.GameResult, error)
func (*MockQuerier) SelectUser ¶
func (*MockQuerier) SelectUsersByValidationStatus ¶
func (*MockQuerier) UpdateGameResult ¶
func (m *MockQuerier) UpdateGameResult(ctx context.Context, txn sqlx.Tx, gameResultId int, validationStatus entity.ValidationStatus) error
func (*MockQuerier) UpdateUserBalance ¶
func (*MockQuerier) WithTransaction ¶
type TestDatabase ¶
type TestDatabase struct {
// contains filtered or unexported fields
}
func NewTestDatabase ¶
func NewTestDatabase(t *testing.T) *TestDatabase
func (*TestDatabase) Close ¶
func (db *TestDatabase) Close(t *testing.T)
func (*TestDatabase) ConnectionString ¶
func (db *TestDatabase) ConnectionString(t *testing.T) string
Click to show internal directories.
Click to hide internal directories.