fix: refactor code to be testable #181
All checks were successful
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 55s
Build Docker Image / Build-Docker-Image (push) Successful in 45s

This commit was merged in pull request #212.
This commit is contained in:
2024-10-12 21:57:39 +02:00
parent 9fd9f9649e
commit 1ed504c49b
19 changed files with 1022 additions and 710 deletions

View File

@@ -35,7 +35,7 @@ func TestUser(t *testing.T) {
t.Parallel()
db := setupDb(t)
underTest := DbAuthSqlite{db: db}
underTest := AuthDbSqlite{db: db}
_, err := underTest.GetUser("someNonExistentEmail")
assert.Equal(t, ErrUserNotFound, err)
@@ -45,7 +45,7 @@ func TestUser(t *testing.T) {
t.Parallel()
db := setupDb(t)
underTest := DbAuthSqlite{db: db}
underTest := AuthDbSqlite{db: db}
verifiedAt := time.Date(2020, 1, 5, 13, 0, 0, 0, time.UTC)
createAt := time.Date(2020, 1, 5, 12, 0, 0, 0, time.UTC)
@@ -64,7 +64,7 @@ func TestUser(t *testing.T) {
t.Parallel()
db := setupDb(t)
underTest := DbAuthSqlite{db: db}
underTest := AuthDbSqlite{db: db}
verifiedAt := time.Date(2020, 1, 5, 13, 0, 0, 0, time.UTC)
createAt := time.Date(2020, 1, 5, 12, 0, 0, 0, time.UTC)
@@ -85,7 +85,7 @@ func TestEmailVerification(t *testing.T) {
t.Parallel()
db := setupDb(t)
underTest := DbAuthSqlite{db: db}
underTest := AuthDbSqlite{db: db}
token, err := underTest.GetEmailVerificationToken(uuid.New())
@@ -96,7 +96,7 @@ func TestEmailVerification(t *testing.T) {
t.Parallel()
db := setupDb(t)
underTest := DbAuthSqlite{db: db}
underTest := AuthDbSqlite{db: db}
userId := uuid.New()
expectedToken := "someToken"