Skip to content

Commit

Permalink
consider descriptive file names
Browse files Browse the repository at this point in the history
  • Loading branch information
MGTheTrain committed Nov 20, 2024
1 parent 5ce3e90 commit fdbb6da
Show file tree
Hide file tree
Showing 22 changed files with 5 additions and 5 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import (
"gorm.io/gorm"
)

// TestContext struct to hold DB and repositories for each test
type TestContext struct {
// TestRepositoryContext struct to hold DB and repositories for each test
type TestRepositoryContext struct {
DB *gorm.DB
BlobRepo *repository.GormBlobRepository
CryptoKeyRepo *repository.GormCryptoKeyRepository
}

// Setup function to initialize the test DB and repositories
func setupTestDB(t *testing.T) *TestContext {
func setupTestDB(t *testing.T) *TestRepositoryContext {
var err error
var db *gorm.DB

Expand Down Expand Up @@ -95,15 +95,15 @@ func setupTestDB(t *testing.T) *TestContext {
cryptoKeyRepo := &repository.GormCryptoKeyRepository{DB: db}

// Return the test context that holds the DB and repositories
return &TestContext{
return &TestRepositoryContext{
DB: db,
BlobRepo: blobRepo,
CryptoKeyRepo: cryptoKeyRepo,
}
}

// Teardown function to clean up after tests (optional, for DB cleanup)
func teardownTestDB(t *testing.T, ctx *TestContext) {
func teardownTestDB(t *testing.T, ctx *TestRepositoryContext) {
sqlDB, err := ctx.DB.DB()
if err != nil {
t.Fatalf("Failed to get DB connection: %v", err)
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit fdbb6da

Please sign in to comment.