2020-01-11 01:59:43 +01:00
|
|
|
// +build osm
|
|
|
|
|
2019-12-22 21:39:25 +01:00
|
|
|
package osm
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
func TestOSM_Name(t *testing.T) {
|
|
|
|
t.Run("Nice Name", func(t *testing.T) {
|
2019-12-31 07:16:11 +01:00
|
|
|
l := &Location{LocCategory: "natural", LocName: "Nice Name", LocType: "hill", LocDisplayName: "dipslay name"}
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Nice Name", l.Name())
|
2019-12-22 21:39:25 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("Water", func(t *testing.T) {
|
2019-12-31 07:16:11 +01:00
|
|
|
l := &Location{LocCategory: "", LocName: "", LocType: "water", LocDisplayName: "dipslay name"}
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Water", l.Name())
|
2019-12-22 21:39:25 +01:00
|
|
|
})
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
t.Run("Nice Name 2", func(t *testing.T) {
|
2019-12-31 07:16:11 +01:00
|
|
|
l := &Location{LocCategory: "shop", LocName: "Nice Name 2", LocType: "", LocDisplayName: "dipslay name"}
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Nice Name 2", l.Name())
|
2019-12-22 21:39:25 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("Cat", func(t *testing.T) {
|
2019-12-31 07:16:11 +01:00
|
|
|
l := &Location{LocCategory: "xxx", LocName: "Cat,Dog", LocType: "", LocDisplayName: "dipslay name"}
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Cat", l.Name())
|
2019-12-22 21:39:25 +01:00
|
|
|
})
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
t.Run("airport", func(t *testing.T) {
|
2019-12-31 07:16:11 +01:00
|
|
|
l := &Location{LocCategory: "aeroway", LocName: "", LocType: "", LocDisplayName: "dipslay name"}
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Airport", l.Name())
|
2019-12-22 21:39:25 +01:00
|
|
|
})
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
t.Run("Cow", func(t *testing.T) {
|
2019-12-31 07:16:11 +01:00
|
|
|
l := &Location{LocCategory: "xxx", LocName: "Cow - Cat - Dog", LocType: "", LocDisplayName: "dipslay name"}
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Cow", l.Name())
|
2019-12-22 21:39:25 +01:00
|
|
|
})
|
|
|
|
}
|