2020-07-10 10:29:56 +02:00
|
|
|
package entity
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2020-11-21 18:08:41 +01:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2020-07-10 10:29:56 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestLocationMap_Get(t *testing.T) {
|
|
|
|
t.Run("get existing location", func(t *testing.T) {
|
2020-07-12 08:27:05 +02:00
|
|
|
r := CellFixtures.Get("mexico")
|
|
|
|
assert.Equal(t, "Adosada Platform", r.CellName)
|
2020-07-10 10:29:56 +02:00
|
|
|
assert.Equal(t, "s2:85d1ea7d382c", r.ID)
|
2020-07-12 08:27:05 +02:00
|
|
|
assert.IsType(t, Cell{}, r)
|
2020-07-10 10:29:56 +02:00
|
|
|
})
|
|
|
|
t.Run("get not existing location", func(t *testing.T) {
|
2020-07-12 08:27:05 +02:00
|
|
|
r := CellFixtures.Get("Fusion 3333")
|
2020-07-10 10:29:56 +02:00
|
|
|
assert.Equal(t, "zz", r.ID)
|
2020-07-12 08:27:05 +02:00
|
|
|
assert.IsType(t, Cell{}, r)
|
2020-07-10 10:29:56 +02:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestLocationMap_Pointer(t *testing.T) {
|
|
|
|
t.Run("get existing location pointer", func(t *testing.T) {
|
2020-07-12 08:27:05 +02:00
|
|
|
r := CellFixtures.Pointer("mexico")
|
|
|
|
assert.Equal(t, "Adosada Platform", r.CellName)
|
2020-07-10 10:29:56 +02:00
|
|
|
assert.Equal(t, "s2:85d1ea7d382c", r.ID)
|
2020-07-12 08:27:05 +02:00
|
|
|
assert.IsType(t, &Cell{}, r)
|
2020-07-10 10:29:56 +02:00
|
|
|
})
|
|
|
|
t.Run("get not existing location pointer", func(t *testing.T) {
|
2020-07-12 08:27:05 +02:00
|
|
|
r := CellFixtures.Pointer("Fusion 444")
|
2020-07-10 10:29:56 +02:00
|
|
|
assert.Equal(t, "zz", r.ID)
|
2020-07-12 08:27:05 +02:00
|
|
|
assert.IsType(t, &Cell{}, r)
|
2020-07-10 10:29:56 +02:00
|
|
|
})
|
|
|
|
}
|