testbuilder

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupDB

func SetupDB(t *testing.T) *sql.DB

SetupDB creates an in-memory SQLite database with migrations applied. The DB is closed automatically when the test completes. Apply migrations from the filesystem rather than the embedded FS which is not populated when running tests.

Types

type GameBuilder

type GameBuilder struct {
	// contains filtered or unexported fields
}

GameBuilder builds a game_install row, creating a store if one is not provided

func NewGame

func NewGame(t *testing.T, db *sql.DB) *GameBuilder

func (*GameBuilder) Build

func (b *GameBuilder) Build() dbq.GameInstall

func (*GameBuilder) NotPresent

func (b *GameBuilder) NotPresent() *GameBuilder

func (*GameBuilder) WithInstallRoot

func (b *GameBuilder) WithInstallRoot(root string) *GameBuilder

func (*GameBuilder) WithInstanceID

func (b *GameBuilder) WithInstanceID(id string) *GameBuilder

func (*GameBuilder) WithName

func (b *GameBuilder) WithName(name string) *GameBuilder

func (*GameBuilder) WithStore

func (b *GameBuilder) WithStore(storeID string) *GameBuilder

func (*GameBuilder) WithStoreGameID

func (b *GameBuilder) WithStoreGameID(id string) *GameBuilder

type ProfileBuilder

type ProfileBuilder struct {
	// contains filtered or unexported fields
}

ProfileBuilder builds a profile row for a game install.

func NewProfile

func NewProfile(t *testing.T, db *sql.DB) *ProfileBuilder

func (*ProfileBuilder) Active

func (b *ProfileBuilder) Active() *ProfileBuilder

func (*ProfileBuilder) Build

func (b *ProfileBuilder) Build() dbq.Profile

func (*ProfileBuilder) WithGame

func (b *ProfileBuilder) WithGame(gi dbq.GameInstall) *ProfileBuilder

func (*ProfileBuilder) WithName

func (b *ProfileBuilder) WithName(name string) *ProfileBuilder

type StoreBuilder

type StoreBuilder struct {
	// contains filtered or unexported fields
}

StoreBuilder builds a store row

func NewStore

func NewStore(t *testing.T, db *sql.DB) *StoreBuilder

func (*StoreBuilder) Build

func (b *StoreBuilder) Build() dbq.Store

func (*StoreBuilder) WithID

func (b *StoreBuilder) WithID(id string) *StoreBuilder

func (*StoreBuilder) WithImplementation

func (b *StoreBuilder) WithImplementation(impl string) *StoreBuilder

Jump to

Keyboard shortcuts

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