Forge
csharpdeeb25a2
1#nullable enable
2using CascadeIDE.Features.Chat;
3using Xunit;
4
5namespace CascadeIDE.Tests;
6
7public sealed class ChatSurfaceSnapshotMessageLookupTests
8{
9 [Fact]
10 public void TryGetMessageBody_finds_entry_in_lane()
11 {
12 var snapshot = new ChatSurfaceSnapshot(
13 ChatSurfaceSnapshot.Empty.State,
14 new ChatSurfaceLayout(
15 [],
16 [
17 new ChatSurfaceLane(
18 new ChatThreadNode(Guid.NewGuid(), "t1", "T", true, true, null, null, 0, 0),
19 [
20 new ChatSurfaceEntry(
21 ChatSurfaceEntryKind.Message,
22 "n1",
23 "Title",
24 "hello body",
25 ChatMessageVisualRole.Assistant,
26 0,
27 MessageIndex: 3)
28 ])
29 ]),
30 ChatProductSpine.Empty);
31
32 Assert.Equal("hello body", ChatSurfaceSnapshotMessageLookup.TryGetMessageBody(snapshot, 3));
33 Assert.Null(ChatSurfaceSnapshotMessageLookup.TryGetMessageBody(snapshot, 99));
34 }
35}
36
View only · write via MCP/CIDE