-
Notifications
You must be signed in to change notification settings - Fork 27
/
address_test.go
109 lines (91 loc) · 2.98 KB
/
address_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package kolpa
import (
"reflect"
"testing"
)
func TestAddress(t *testing.T) {
k := C()
for _, lang := range getLanguages() {
k.SetLanguage(lang)
address := k.Address()
typeOfOutput := reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("Address generation is failed for %s.", lang)
}
address = k.BuildingNumber()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("BuildingNumber generation is failed for %s.", lang)
}
address = k.City()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("City generation is failed for %s.", lang)
}
address = k.CityPrefix()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("CityPrefix generation is failed for %s.", lang)
}
address = k.CitySuffix()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("CitySuffix generation is failed for %s.", lang)
}
address = k.MilitaryAPO()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("MilitaryAPO generation is failed for %s.", lang)
}
address = k.MilitaryDPO()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("MilitaryDPO generation is failed for %s.", lang)
}
address = k.MilitaryShipPrefix()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("MilitaryShipPrefix generation is failed for %s.", lang)
}
address = k.MilitaryStateAbbr()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("MilitaryStateAbbr generation is failed for %s.", lang)
}
address = k.Postcode()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("Postcode generation is failed for %s.", lang)
}
address = k.SecondaryAddress()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("SecondaryAddress generation is failed for %s.", lang)
}
address = k.StateAbbr()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("StateAbbr generation is failed for %s.", lang)
}
address = k.State()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("State generation is failed for %s.", lang)
}
address = k.StreetAddress()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("StreetAddress generation is failed for %s.", lang)
}
address = k.StreetName()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("StreetName generation is failed for %s.", lang)
}
address = k.StreetSuffix()
typeOfOutput = reflect.TypeOf(address).Kind()
if typeOfOutput != reflect.String {
t.Errorf("StreetSuffix generation is failed for %s.", lang)
}
}
}