Porting golang yelp wrapper to v3-fusion-api
This commit is contained in:
43
yelp/location_options_test.go
Normal file
43
yelp/location_options_test.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package yelp
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/guregu/null"
|
||||
)
|
||||
|
||||
// TestLocationOptions will check using location options by term.
|
||||
func TestLocationOptions(t *testing.T) {
|
||||
client := getClient(t)
|
||||
options := SearchOptions{
|
||||
GeneralOptions: &GeneralOptions{
|
||||
Term: "coffee",
|
||||
},
|
||||
LocationOptions: &LocationOptions{
|
||||
Location: "seattle",
|
||||
},
|
||||
}
|
||||
result, err := client.DoSearch(options)
|
||||
check(t, err)
|
||||
assert(t, len(result.Businesses) > 0, containsResults)
|
||||
}
|
||||
|
||||
// TestLocationWithCoordinates will check using location options with bounding coordinates.
|
||||
func TestLocationWithCoordinates(t *testing.T) {
|
||||
client := getClient(t)
|
||||
options := SearchOptions{
|
||||
GeneralOptions: &GeneralOptions{
|
||||
Term: "food",
|
||||
},
|
||||
LocationOptions: &LocationOptions{
|
||||
"bellevue",
|
||||
&CoordinateOptions{
|
||||
Latitude: null.FloatFrom(37.788022),
|
||||
Longitude: null.FloatFrom(-122.399797),
|
||||
},
|
||||
},
|
||||
}
|
||||
result, err := client.DoSearch(options)
|
||||
check(t, err)
|
||||
assert(t, len(result.Businesses) > 0, containsResults)
|
||||
}
|
||||
Reference in New Issue
Block a user