photoprism/internal/entity/album_fixtures_test.go
Michael Mayer 03ec4b586d Initial commit for folders and moments #154 #260 #331
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-05-23 20:58:58 +02:00

34 lines
986 B
Go

package entity
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestAlbumMap_Get(t *testing.T) {
t.Run("get existing album", func(t *testing.T) {
r := AlbumFixtures.Get("christmas2030")
assert.Equal(t, "at9lxuqxpogaaba7", r.AlbumUID)
assert.Equal(t, "christmas2030", r.AlbumSlug)
assert.IsType(t, Album{}, r)
})
t.Run("get not existing album", func(t *testing.T) {
r := AlbumFixtures.Get("Fusion 3333")
assert.Equal(t, "fusion-3333", r.AlbumSlug)
assert.IsType(t, Album{}, r)
})
}
func TestAlbumMap_Pointer(t *testing.T) {
t.Run("get existing album pointer", func(t *testing.T) {
r := AlbumFixtures.Pointer("christmas2030")
assert.Equal(t, "at9lxuqxpogaaba7", r.AlbumUID)
assert.Equal(t, "christmas2030", r.AlbumSlug)
assert.IsType(t, &Album{}, r)
})
t.Run("get not existing album pointer", func(t *testing.T) {
r := AlbumFixtures.Pointer("Fusion 444")
assert.Equal(t, "fusion-444", r.AlbumSlug)
assert.IsType(t, &Album{}, r)
})
}