From 186d1f26e7f0bc404b00476e09f8f7942140b2f6 Mon Sep 17 00:00:00 2001 From: graciousgrey Date: Mon, 26 Jun 2023 15:55:05 +0200 Subject: [PATCH] Tests: Add unit tests for internal/entity --- internal/entity/password_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/entity/password_test.go b/internal/entity/password_test.go index c4394a368..e60ddd4ef 100644 --- a/internal/entity/password_test.go +++ b/internal/entity/password_test.go @@ -159,6 +159,11 @@ func TestPassword_Cost(t *testing.T) { assert.Equal(t, 14, cost) } }) + t.Run("empty password", func(t *testing.T) { + p := NewPassword("urrwaxd19ldtz68x", "", false) + _, err := p.Cost() + assert.Error(t, err) + }) } func TestPassword_String(t *testing.T) {