Files
photoprism/internal/entity/query/account_test.go
2025-10-02 14:50:02 +02:00

30 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)
})
}