functional

package
v0.0.0-...-dc6aa82 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupTestDB

func CleanupTestDB(db *gorm.DB) error

CleanupTestDB drops all test tables

func CreateTestAccount

func CreateTestAccount(userID uint, accountNumber string, accountType models.AccountType, balance float64) (*models.Account, error)

CreateTestAccount creates a test account for tests

func CreateTestUser

func CreateTestUser(email, password, firstName, lastName string) (*models.User, error)

CreateTestUser creates a test user for tests

func LoginTestUser

func LoginTestUser(email, password string) (string, error)

LoginTestUser logs in a test user and returns the auth token

func MakeRequest

func MakeRequest(method, url string, body interface{}, token string) *httptest.ResponseRecorder

MakeRequest is a helper function to make HTTP requests for tests

func SetupTest

func SetupTest(t *testing.T)

SetupTest initializes everything for tests

func SetupTestDB

func SetupTestDB(t *testing.T) (*gorm.DB, error)

SetupTestDB initializes a test database connection

func SetupTestRouter

func SetupTestRouter(db *gorm.DB) *gin.Engine

SetupTestRouter creates a router with all the routes for testing

func TestMain

func TestMain(m *testing.M)

TestMain is the main entry point for tests

Types

This section is empty.

Jump to

Keyboard shortcuts

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