(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestMemoryStore_CreateGet(t *testing.T) { |
| 10 | st := NewMemoryStore() |
| 11 | ctx := context.Background() |
| 12 | row := RequestRow{ |
| 13 | RequestID: "r1", |
| 14 | TenantID: "t", |
| 15 | TaskType: "chat", |
| 16 | Priority: "p", |
| 17 | CreatedAt: time.Now(), |
| 18 | UpdatedAt: time.Now(), |
| 19 | } |
| 20 | if err := st.CreateRequest(ctx, row); err != nil { |
| 21 | t.Fatal(err) |
| 22 | } |
| 23 | got, err := st.GetRequest(ctx, "r1") |
| 24 | if err != nil { |
| 25 | t.Fatal(err) |
| 26 | } |
| 27 | if got.RequestID != "r1" || got.TenantID != "t" { |
| 28 | t.Fatalf("%+v", got) |
| 29 | } |
| 30 | if err := st.CreateRequest(ctx, row); err == nil { |
| 31 | t.Fatal("expected duplicate error") |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | func TestMemoryStore_GetRequest_NotFound(t *testing.T) { |
| 36 | st := NewMemoryStore() |
nothing calls this directly
no test coverage detected