2021-06-02 17:25:04 +02:00
|
|
|
package form
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestNewMarker(t *testing.T) {
|
|
|
|
t.Run("success", func(t *testing.T) {
|
|
|
|
var m = struct {
|
2021-09-17 14:26:12 +02:00
|
|
|
SubjSrc string
|
2021-08-24 14:27:34 +02:00
|
|
|
MarkerName string
|
2021-09-17 14:26:12 +02:00
|
|
|
MarkerReview bool
|
2021-08-16 01:52:02 +02:00
|
|
|
MarkerInvalid bool
|
2021-06-02 17:25:04 +02:00
|
|
|
}{
|
2021-09-17 14:26:12 +02:00
|
|
|
SubjSrc: "manual",
|
2021-08-16 01:52:02 +02:00
|
|
|
MarkerName: "Foo",
|
2021-09-17 14:26:12 +02:00
|
|
|
MarkerReview: true,
|
2021-08-16 01:52:02 +02:00
|
|
|
MarkerInvalid: true,
|
2021-06-02 17:25:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
f, err := NewMarker(m)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2021-09-17 14:26:12 +02:00
|
|
|
assert.Equal(t, "manual", f.SubjSrc)
|
2021-08-16 00:29:36 +02:00
|
|
|
assert.Equal(t, "Foo", f.MarkerName)
|
2021-09-17 14:26:12 +02:00
|
|
|
assert.Equal(t, true, f.MarkerReview)
|
2021-08-16 01:52:02 +02:00
|
|
|
assert.Equal(t, true, f.MarkerInvalid)
|
2021-06-02 17:25:04 +02:00
|
|
|
})
|
|
|
|
}
|