forked from yasvisu/gw2api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
recipes_test.go
44 lines (36 loc) · 1.05 KB
/
recipes_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
package gw2api
import "testing"
func TestRecipesIds(t *testing.T) {
var err error
api := NewGW2Api()
var testRecipes []int
if testRecipes, err = api.Recipes(); err != nil {
t.Error("Failed to fetch recipe ids")
}
var recipes []Recipe
if recipes, err = api.RecipeIds(testRecipes[0:2]...); err != nil {
t.Error("Failed to parse the recipe data: ", err)
} else if len(recipes) != 2 {
t.Error("Failed to fetch existing recipes")
}
}
func TestRecipesSearchInput(t *testing.T) {
var err error
api := NewGW2Api()
var recipes []int
if recipes, err = api.RecipeSearchInput(46731); err != nil {
t.Error("Failed to parse the recipe data: ", err)
} else if len(recipes) < 9 {
t.Error("Failed to fetch existing recipes: 9 > ", len(recipes))
}
}
func TestRecipesSearchOutput(t *testing.T) {
var err error
api := NewGW2Api()
var recipes []int
if recipes, err = api.RecipeSearchOutput(50065); err != nil {
t.Error("Failed to parse the recipe data: ", err)
} else if len(recipes) < 3 {
t.Error("Failed to fetch existing recipes: 3 > ", len(recipes))
}
}