testutils

package
v0.0.0-...-1cb44fa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockGameRepository

type MockGameRepository struct {
	PlayersData   []models.Player
	GameSavesData []models.GameSave
}

func NewMockGameRepository

func NewMockGameRepository() *MockGameRepository

func NewMockGameRepositoryWithData

func NewMockGameRepositoryWithData(players []models.Player, saves []models.GameSave) *MockGameRepository

func (*MockGameRepository) AddPlayer

func (m *MockGameRepository) AddPlayer(player models.Player) error

AddPlayer adds a player to the mock repository

func (*MockGameRepository) ComputeHighScores

func (m *MockGameRepository) ComputeHighScores() ([]models.HighScore, error)

ComputeHighScores computes the high scores

func (*MockGameRepository) HasIncompleteGames

func (m *MockGameRepository) HasIncompleteGames() bool

HasIncompleteGames checks if there are incomplete games

func (*MockGameRepository) IncompleteGames

func (m *MockGameRepository) IncompleteGames() ([]models.GameSave, error)

IncompleteGames returns all incomplete games

func (*MockGameRepository) LifetimeStats

func (m *MockGameRepository) LifetimeStats() (*models.LifetimeStats, error)

LifetimeStats returns the lifetime stats

func (*MockGameRepository) LoadGame

func (m *MockGameRepository) LoadGame(gameID string) (models.GameSave, error)

LoadGame loads a game from the mock repository by its ID

func (*MockGameRepository) LoadGameState

func (m *MockGameRepository) LoadGameState(gameID string) (models.GameState, error)

LoadGameState loads the game state by its ID

func (*MockGameRepository) PlayerLifetimeStats

func (m *MockGameRepository) PlayerLifetimeStats(playerID string) (*models.LifetimeStats, error)

PlayerLifetimeStats returns the lifetime stats for a player

func (*MockGameRepository) Players

func (m *MockGameRepository) Players() ([]models.Player, error)

Players returns all players in the mock repository

func (*MockGameRepository) SaveGame

func (m *MockGameRepository) SaveGame(save models.GameSave) error

SaveGame saves a game to the mock repository

type MockTeaModel

type MockTeaModel struct {
	InitCalled   bool
	UpdateCalled bool
	ViewCalled   bool
}

MockTeaModel is a mock implementation of tea.Model for testing

func (*MockTeaModel) Init

func (m *MockTeaModel) Init() tea.Cmd

func (*MockTeaModel) Update

func (m *MockTeaModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*MockTeaModel) View

func (m *MockTeaModel) View() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL