(t *testing.T)
| 45 | } |
| 46 | |
| 47 | func TestAddMemory(t *testing.T) { |
| 48 | t.Parallel() |
| 49 | db := setupTestDB(t) |
| 50 | |
| 51 | ctx := t.Context() |
| 52 | |
| 53 | memory := database.UserMemory{ |
| 54 | ID: "test-id-1", |
| 55 | CreatedAt: time.Now().Format(time.RFC3339), |
| 56 | Memory: "Test memory content", |
| 57 | } |
| 58 | |
| 59 | err := db.AddMemory(ctx, memory) |
| 60 | require.NoError(t, err, "Adding memory should succeed") |
| 61 | |
| 62 | err = db.AddMemory(ctx, memory) |
| 63 | require.Error(t, err, "Adding memory with duplicate ID should fail") |
| 64 | |
| 65 | emptyIDMemory := database.UserMemory{ |
| 66 | ID: "", |
| 67 | CreatedAt: time.Now().Format(time.RFC3339), |
| 68 | Memory: "Empty ID memory", |
| 69 | } |
| 70 | |
| 71 | err = db.AddMemory(ctx, emptyIDMemory) |
| 72 | require.Error(t, err, "Adding memory with empty ID should fail") |
| 73 | } |
| 74 | |
| 75 | func TestAddMemoryWithCategory(t *testing.T) { |
| 76 | t.Parallel() |
nothing calls this directly
no test coverage detected