Files
food-ai/backend/tests/recipe/repository_integration_test.go
dbastrikin 6594013b53 refactor: introduce internal/domain/ layer, rename model.go → entity.go
Move all business-logic packages from internal/ root into internal/domain/:
  auth, cuisine, diary, dish, home, ingredient, language, menu, product,
  recipe, recognition, recommendation, savedrecipe, tag, units, user

Rename model.go → entity.go in packages that hold domain entities:
  diary, dish, home, ingredient, menu, product, recipe, savedrecipe, user

Update all import paths accordingly (adapters, infra/server, cmd/server,
tests). No logic changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 22:12:07 +02:00

37 lines
800 B
Go

//go:build integration
package recipe_test
import (
"context"
"testing"
"github.com/food-ai/backend/internal/domain/recipe"
"github.com/food-ai/backend/internal/testutil"
)
func TestRecipeRepository_GetByID_NotFound(t *testing.T) {
pool := testutil.SetupTestDB(t)
repo := recipe.NewRepository(pool)
ctx := context.Background()
got, getError := repo.GetByID(ctx, "00000000-0000-0000-0000-000000000000")
if getError != nil {
t.Fatalf("unexpected error: %v", getError)
}
if got != nil {
t.Error("expected nil for non-existent ID")
}
}
func TestRecipeRepository_Count(t *testing.T) {
pool := testutil.SetupTestDB(t)
repo := recipe.NewRepository(pool)
ctx := context.Background()
_, countError := repo.Count(ctx)
if countError != nil {
t.Fatalf("count: %v", countError)
}
}