blob: 1d9eda1f088ee1c52a15f37eaff94576999a8be6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package model
import (
"testing"
)
func TestRecipesRead(t *testing.T) {
InitStorage()
defer RemoveStorage()
InitDatabase()
defer CloseDatabase()
r := make(Recipes, 0)
err := r.Read()
if err != nil {
t.Fatalf("Failed to read Recipes: %v\n", err)
}
if len(r) != 2 { // TODO this needs to be aligned with model/sql/testdata.sql
t.Fatalf("Expected a list of one recipe but got %d", len(r))
}
}
|