- 菜谱API基本OK

This commit is contained in:
gazebo
2019-09-17 14:36:39 +08:00
parent daa72b7b7d
commit bf8fd2f255
6 changed files with 401 additions and 16 deletions

View File

@@ -0,0 +1,40 @@
package dao
import (
"testing"
)
func TestQueryRecipes(t *testing.T) {
db := GetDB()
recipeList, err := QueryFoodRecipes(db, "", -1, "", "")
if err != nil {
t.Fatal(err)
}
if len(recipeList) > 0 {
t.Fatal("should not return list")
}
recipeItemList, err := QueryFoodRecipesItems(db, -1)
if err != nil {
t.Fatal(err)
}
if len(recipeItemList) > 0 {
t.Fatal("should not return list")
}
choiceList, err := QueryFoodRecipesItemChoices(db, -1)
if err != nil {
t.Fatal(err)
}
if len(choiceList) > 0 {
t.Fatal("should not return list")
}
stepList, err := QueryFoodRecipesSteps(db, -1)
if err != nil {
t.Fatal(err)
}
if len(stepList) > 0 {
t.Fatal("should not return list")
}
}