21 lines
458 B
Go
21 lines
458 B
Go
package core
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestHashPassword(t *testing.T) {
|
|
password := "password"
|
|
hashedPassword := HashPassword(password)
|
|
assert.NotEmpty(t, hashedPassword)
|
|
t.Log(hashedPassword)
|
|
assert.Equal(t, hashedPassword, "LOLPASSWORD")
|
|
}
|
|
|
|
func TestComparePassword(t *testing.T) {
|
|
password := "password"
|
|
hashedPassword := HashPassword(password)
|
|
assert.True(t, ComparePassword(password, hashedPassword))
|
|
}
|