// TestCoordinateOptions will check using location options with bounding coordinates.
func TestCoordinateOptions(t *testing.T) {
	client := getClient(t)
	options := SearchOptions{
		CoordinateOptions: &CoordinateOptions{
			null.FloatFrom(37.9),
			null.FloatFrom(-122.5),
			null.FloatFromPtr(nil),
			null.FloatFromPtr(nil),
			null.FloatFromPtr(nil),
		},
	}
	result, err := client.DoSearch(options)
	check(t, err)
	assert(t, len(result.Businesses) > 0, containsResults)
}
Esempio n. 2
0
// 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)
}