2021-09-18 15:32:39 +02:00
|
|
|
package form
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestNewFace(t *testing.T) {
|
|
|
|
t.Run("success", func(t *testing.T) {
|
|
|
|
var m = struct {
|
2021-09-18 20:41:30 +02:00
|
|
|
FaceHidden bool `json:"Hidden"`
|
|
|
|
SubjUID string `json:"SubjUID"`
|
2021-09-18 15:32:39 +02:00
|
|
|
}{
|
2021-09-18 20:41:30 +02:00
|
|
|
FaceHidden: true,
|
|
|
|
SubjUID: "jqzmd5q3b8o2yxu7",
|
2021-09-18 15:32:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
f, err := NewFace(m)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2021-09-18 20:41:30 +02:00
|
|
|
assert.True(t, f.FaceHidden)
|
2021-09-18 15:32:39 +02:00
|
|
|
assert.Equal(t, "jqzmd5q3b8o2yxu7", f.SubjUID)
|
|
|
|
})
|
|
|
|
}
|