features/module-name #14

Merged
jtom38 merged 9 commits from features/module-name into main 2024-04-05 17:55:07 -07:00
2 changed files with 8 additions and 6 deletions
Showing only changes of commit 8dd80e4806 - Show all commits

View File

@ -3,10 +3,11 @@ package services
import ( import (
"database/sql" "database/sql"
"errors" "errors"
"go-cook/api/domain"
"go-cook/api/repositories"
"strings" "strings"
"git.jamestombleson.com/jtom38/go-cook/api/domain"
"git.jamestombleson.com/jtom38/go-cook/api/repositories"
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
) )

View File

@ -1,9 +1,10 @@
package services_test package services_test
import ( import (
"go-cook/api/services"
"testing" "testing"
"git.jamestombleson.com/jtom38/go-cook/api/services"
"github.com/DATA-DOG/go-sqlmock" "github.com/DATA-DOG/go-sqlmock"
) )
@ -23,7 +24,7 @@ func TestPasswordIsLongEnough(t *testing.T) {
} }
} }
func TestPasswordIsToShort(t *testing.T){ func TestPasswordIsToShort(t *testing.T) {
db, _, err := sqlmock.New() db, _, err := sqlmock.New()
if err != nil { if err != nil {
t.Log(err.Error()) t.Log(err.Error())
@ -35,7 +36,7 @@ func TestPasswordIsToShort(t *testing.T){
err = client.CheckPasswordForRequirements("short") err = client.CheckPasswordForRequirements("short")
if err != nil { if err != nil {
msg := err.Error() msg := err.Error()
if (msg != services.ErrPasswordNotLongEnough) { if msg != services.ErrPasswordNotLongEnough {
t.Log("wrong error") t.Log("wrong error")
t.FailNow() t.FailNow()
} }