From b62c686702622b747ab082b7b12b3e611e1d7e1f Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 3 Mar 2024 20:06:40 +0100 Subject: model: Create test data with Go instead of SQL This allows to formulate the test data with an object-based model which is easier than writing it down in a relational model. --- model/recipe.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'model/recipe.go') diff --git a/model/recipe.go b/model/recipe.go index c9ef6fb..ce16ee4 100644 --- a/model/recipe.go +++ b/model/recipe.go @@ -126,3 +126,26 @@ func (r *Recipe) Delete() error { return nil } + +func RecipeTestData() []Recipe { + return []Recipe{ + { + Id: "1", + Title: "Pancakes", + Portions: "4", + Url: "https://example.org", + Notes: "Very fluffy", + Created: "", + LastChanged: "", + }, + { + Id: "2", + Title: "Burger", + Portions: "2", + Url: "https://xengineering.eu/git/ceres", + Notes: "Delicious!", + Created: "", + LastChanged: "", + }, + } +} -- cgit v1.2.3-70-g09d2