2023-03-20 16:18:27 +01:00
|
|
|
package form
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestNewFile(t *testing.T) {
|
|
|
|
t.Run("Orientation", func(t *testing.T) {
|
|
|
|
var file = struct {
|
2023-03-20 16:41:23 +01:00
|
|
|
FileOrientation int
|
2023-03-20 16:18:27 +01:00
|
|
|
}{
|
2023-03-20 16:41:23 +01:00
|
|
|
FileOrientation: 3,
|
2023-03-20 16:18:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
frm, err := NewFile(file)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2023-03-20 16:41:23 +01:00
|
|
|
assert.Equal(t, 3, frm.FileOrientation)
|
|
|
|
assert.Equal(t, 3, frm.Orientation())
|
|
|
|
frm.FileOrientation = 10
|
|
|
|
assert.Equal(t, 10, frm.FileOrientation)
|
|
|
|
assert.Equal(t, 0, frm.Orientation())
|
2023-03-20 16:18:27 +01:00
|
|
|
})
|
|
|
|
}
|