testutil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package testutil provides shared test utilities for integration tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UniqueFixtureName

func UniqueFixtureName(prefix string) string

UniqueFixtureName generates a unique fixture name for testing.

func UniqueProjectName

func UniqueProjectName(prefix string) string

UniqueProjectName generates a unique project name for testing. This ensures tests don't conflict with each other.

Types

type TestDB

type TestDB struct {
	DB          *gorm.DB
	ProjectRepo *repositories.ProjectRepository
	FixtureRepo *repositories.FixtureRepository
	LookRepo    *repositories.LookRepository
	CueListRepo *repositories.CueListRepository
	CueRepo     *repositories.CueRepository
}

TestDB holds the test database and repositories.

func SetupTestDB

func SetupTestDB(t *testing.T) (*TestDB, func())

SetupTestDB creates an in-memory SQLite database for testing. It returns a TestDB with all repositories initialized and a cleanup function.

Jump to

Keyboard shortcuts

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