photoprism/internal/form/marker_test.go
2021-08-24 14:27:34 +02:00

31 lines
519 B
Go

package form
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNewMarker(t *testing.T) {
t.Run("success", func(t *testing.T) {
var m = struct {
SubjectSrc string
MarkerName string
MarkerInvalid bool
}{
SubjectSrc: "manual",
MarkerName: "Foo",
MarkerInvalid: true,
}
f, err := NewMarker(m)
if err != nil {
t.Fatal(err)
}
assert.Equal(t, "manual", f.SubjectSrc)
assert.Equal(t, "Foo", f.MarkerName)
assert.Equal(t, true, f.MarkerInvalid)
})
}