| 7 | ) |
| 8 | |
| 9 | func TestNewEvent(t *testing.T) { |
| 10 | invocationID := "test-invocation" |
| 11 | event := NewEvent(invocationID) |
| 12 | |
| 13 | if event == nil { |
| 14 | t.Fatal("expected Event, got nil") |
| 15 | } |
| 16 | |
| 17 | if event.InvocationID != invocationID { |
| 18 | t.Errorf("expected InvocationID '%s', got '%s'", invocationID, event.InvocationID) |
| 19 | } |
| 20 | |
| 21 | if event.ID == "" { |
| 22 | t.Error("expected event ID to be generated") |
| 23 | } |
| 24 | |
| 25 | if event.Actions.StateDelta == nil { |
| 26 | t.Error("expected StateDelta to be initialized") |
| 27 | } |
| 28 | |
| 29 | if event.Actions.ArtifactDelta == nil { |
| 30 | t.Error("expected ArtifactDelta to be initialized") |
| 31 | } |
| 32 | |
| 33 | if event.Metadata == nil { |
| 34 | t.Error("expected Metadata to be initialized") |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | func TestEvent_IsFinalResponse_WithSkipSummarization(t *testing.T) { |
| 39 | event := &Event{ |