Documentation
¶
Index ¶
- func CleanupTestDB(db *gorm.DB) error
- func CreateTestAccount(userID uint, accountNumber string, accountType models.AccountType, ...) (*models.Account, error)
- func CreateTestUser(email, password, firstName, lastName string) (*models.User, error)
- func LoginTestUser(email, password string) (string, error)
- func MakeRequest(method, url string, body interface{}, token string) *httptest.ResponseRecorder
- func SetupTest(t *testing.T)
- func SetupTestDB(t *testing.T) (*gorm.DB, error)
- func SetupTestRouter(db *gorm.DB) *gin.Engine
- func TestMain(m *testing.M)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
CreateTestUser creates a test user for tests
func LoginTestUser ¶
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 SetupTestDB ¶
SetupTestDB initializes a test database connection
func SetupTestRouter ¶
SetupTestRouter creates a router with all the routes for testing
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.