2019-02-22 15:55:11 +03:00
|
|
|
package areasparser
|
|
|
|
|
|
|
|
import (
|
2019-02-22 15:57:33 +03:00
|
|
|
"testing"
|
2021-04-12 14:30:30 +03:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2019-02-22 15:55:11 +03:00
|
|
|
)
|
|
|
|
|
2019-02-22 15:57:33 +03:00
|
|
|
func TestParse(t *testing.T) {
|
2021-04-12 14:30:30 +03:00
|
|
|
a, err := ParseFile("testdata/areas.json")
|
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.True(t, len(a) > 1)
|
|
|
|
|
|
|
|
area := a[0]
|
|
|
|
assert.Equal(t, "ilai_house", area.Name)
|
|
|
|
assert.Equal(t, "ilai", area.Owner)
|
|
|
|
assert.NotNil(t, area.Pos1)
|
|
|
|
assert.NotNil(t, area.Pos2)
|
|
|
|
assert.Equal(t, 4970, area.Pos1.X)
|
2019-02-22 15:55:11 +03:00
|
|
|
}
|