summaryrefslogtreecommitdiff
path: root/model/recipe_test.go
AgeCommit message (Collapse)Author
2024-03-04model: Implement Stringer interface for Recipexengineering
This allows to print a recipe with a fmt.Printf() call more easily: fmt.Printf("%s\n", recipe) This is also used for better error output in unit tests with t.Fatalf(). The Stringer interface is implemented with the JSON package because an indented version of a recipe is a useful string representation.
2024-03-04model: Create test data with Go instead of SQLxengineering
This allows to formulate the test data with an object-based model which is easier than writing it down in a relational model.
2024-02-11model: Implement CRUD methods for type Recipexengineering
The new Go type 'Recipe' should contain every information directly related to a recipe. It should be sufficient to pass it to a template to directly render a HTML view or edit page for the recipe or to a template to generate a PDF. The CRUD methods are: - func (r *Recipe) Create() error - func (r *Recipe) Update() error - func (r *Recipe) Read() error - func (r *Recipe) Delete() error Together with the type itself they are the interface the model package provides for recipes.