Add test for index_options.go

This commit is contained in:
Theresa Gresch 2020-01-20 18:34:15 +01:00
parent 563ce1d112
commit 8e16a9c832

View file

@ -0,0 +1,30 @@
package photoprism
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestIndexOptionsNone(t *testing.T) {
result := IndexOptionsNone()
assert.Equal(t, false, result.UpdateCamera)
assert.Equal(t, false, result.UpdateDate)
assert.Equal(t, false, result.UpdateColors)
}
func TestIndexOptions_UpdateAny(t *testing.T) {
t.Run("true", func(t *testing.T) {
result := IndexOptionsAll()
assert.True(t, result.UpdateAny())
})
t.Run("true", func(t *testing.T) {
result := IndexOptionsNone()
assert.False(t, result.UpdateAny())
})
}
func TestIndexOptions_SkipUnchanged(t *testing.T) {
result := IndexOptionsNone()
assert.True(t, result.SkipUnchanged())
}