Documentation
¶
Index ¶
- type TestAccount
- type TestBlogPost
- type TestComment
- type TestContact
- type TestContext
- func (tc *TestContext) AddCleanupFunc(cleanup func() error)
- func (tc *TestContext) Cleanup() error
- func (tc *TestContext) ClearTableData(t *testing.T, tableName string)
- func (tc *TestContext) CreateTable(t *testing.T, model any)
- func (tc *TestContext) CreateTableIfNotExists(t *testing.T, model any)
- func (tc *TestContext) DeleteTable(t *testing.T, tableName string)
- func (tc *TestContext) WaitForTable(t *testing.T, tableName string)
- type TestNote
- type TestOrder
- type TestProduct
- type TestUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestAccount ¶
type TestBlogPost ¶
type TestComment ¶
type TestContact ¶
type TestContext ¶
type TestContext struct {
DB core.ExtendedDB
DynamoDBClient *dynamodb.Client
TablesCreated []string
// contains filtered or unexported fields
}
TestContext holds test database and cleanup functions
func InitTestDB ¶
func InitTestDB(t *testing.T) *TestContext
InitTestDB creates a test database instance with proper cleanup setup
func (*TestContext) AddCleanupFunc ¶
func (tc *TestContext) AddCleanupFunc(cleanup func() error)
AddCleanupFunc adds a custom cleanup function
func (*TestContext) Cleanup ¶
func (tc *TestContext) Cleanup() error
Cleanup performs all registered cleanup operations
func (*TestContext) ClearTableData ¶
func (tc *TestContext) ClearTableData(t *testing.T, tableName string)
ClearTableData removes all items from a table
func (*TestContext) CreateTable ¶
func (tc *TestContext) CreateTable(t *testing.T, model any)
CreateTable creates a table and registers it for cleanup
func (*TestContext) CreateTableIfNotExists ¶
func (tc *TestContext) CreateTableIfNotExists(t *testing.T, model any)
CreateTableIfNotExists creates a table only if it doesn't exist
func (*TestContext) DeleteTable ¶
func (tc *TestContext) DeleteTable(t *testing.T, tableName string)
DeleteTable deletes a table (alternative cleanup strategy)
func (*TestContext) WaitForTable ¶
func (tc *TestContext) WaitForTable(t *testing.T, tableName string)
WaitForTable waits for a table to become active
type TestProduct ¶
Click to show internal directories.
Click to hide internal directories.