2019-12-11 16:55:18 +01:00
|
|
|
package entity
|
2019-07-16 12:53:23 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2019-12-11 14:10:20 +01:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2019-07-16 12:53:23 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestNewCountry(t *testing.T) {
|
|
|
|
t.Run("name Fantasy code fy", func(t *testing.T) {
|
|
|
|
country := NewCountry("fy", "Fantasy")
|
|
|
|
assert.Equal(t, "fy", country.ID)
|
|
|
|
assert.Equal(t, "Fantasy", country.CountryName)
|
|
|
|
assert.Equal(t, "fantasy", country.CountrySlug)
|
|
|
|
})
|
|
|
|
t.Run("name Unknown code Unknown", func(t *testing.T) {
|
|
|
|
country := NewCountry("", "")
|
|
|
|
assert.Equal(t, "zz", country.ID)
|
|
|
|
assert.Equal(t, "Unknown", country.CountryName)
|
|
|
|
assert.Equal(t, "unknown", country.CountrySlug)
|
|
|
|
})
|
|
|
|
}
|