1
0

Porting golang yelp wrapper to v3-fusion-api

This commit is contained in:
2018-03-28 00:06:15 +02:00
parent 2be94f4c7b
commit c4f8b16a01
14 changed files with 891 additions and 1 deletions

20
yelp/business_test.go Normal file
View File

@@ -0,0 +1,20 @@
package yelp
import (
"testing"
)
// TestBusinessSearch will perform a simple search for a business by name.
func TestBusinessSearch(t *testing.T) {
client := getClient(t)
result, err := client.GetBusiness("north-india-restaurant-san-francisco")
check(t, err)
assert(t, result.Name != "", containsResults)
}
// TestNonExistingBusinessSearch will verify searching for a non-existent business throws the right error.
func TestNonExistingBusinessSearch(t *testing.T) {
client := getClient(t)
_, err := client.GetBusiness("place-that-doesnt-exist")
assert(t, err == errBusinessNotFound, "Searching for a non-existent business should return a 404 error")
}