photoprism/internal/entity/query/account_test.go
Michael Mayer 94b6631b3d Test: Use PascalCase names for all Go subtests in /internal
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-10-02 14:50:02 +02:00

29 lines
486 B
Go

package query
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestAccountByID(t *testing.T) {
t.Run("ExistingAccount", func(t *testing.T) {
r, err := AccountByID(uint(1000001))
if err != nil {
t.Fatal(err)
}
assert.Equal(t, "Test Account2", r.AccName)
})
t.Run("RecordNotFound", func(t *testing.T) {
r, err := AccountByID(uint(123))
if err == nil {
t.Fatal()
}
assert.Equal(t, "record not found", err.Error())
assert.Empty(t, r)
})
}