-
Notifications
You must be signed in to change notification settings - Fork 56
/
location_criterion_test.go
39 lines (36 loc) · 912 Bytes
/
location_criterion_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
package gads
import (
"fmt"
"testing"
// "encoding/xml"
)
func testLocationCriterionService(t *testing.T) (service *LocationCriterionService) {
return &LocationCriterionService{Auth: testAuthSetup(t)}
}
func TestLocationCriterion(t *testing.T) {
lcs := testLocationCriterionService(t)
locationCriterions, err := lcs.Get(
Selector{
Fields: []string{
"Id",
"LocationName",
"CanonicalName",
"DisplayType",
"ParentLocations",
"Reach",
"TargetingStatus",
},
Predicates: []Predicate{
{"LocationName", "IN", []string{"Cameroon", "India", "Iraq", "Nigeria", "Pakistan", "Philippines"}},
{"Locale", "EQUALS", []string{"en"}},
},
},
)
if err != nil {
t.Error(err)
}
for _, locationCriterion := range locationCriterions {
location := locationCriterion.Location
fmt.Printf("%d. %s, %s\n", location.Id, location.LocationName, location.DisplayType)
}
}