Forge
csharpdeeb25a2
1using CascadeIDE.Services;
2using Xunit;
3
4namespace CascadeIDE.Tests;
5
6public sealed class IntentCatalogLoaderTests
7{
8 [Fact]
9 public void BundledCatalog_HasTopicOpen_WithAutoRun()
10 {
11 Assert.True(IntentSlashCatalog.TryGetRoute("/intercom topic open", out var route));
12 Assert.True(route.AutoRunOnCommit);
13 Assert.False(route.AutoRunRequiresArgs);
14 Assert.Equal("topic_open", route.IntercomHandlerId);
15 }
16
17 [Fact]
18 public void ParseBundleForTests_RejectsDuplicateSlashPath()
19 {
20 const string toml = """
21 [[command]]
22 command_id = "x"
23 [[command.form.slash]]
24 path = "/dup"
25 help = "one"
26 [[command]]
27 command_id = "y"
28 [[command.form.slash]]
29 path = "/dup"
30 help = "two"
31 """;
32
33 Assert.Throws<InvalidOperationException>(() => IntentMelodyAliases.ParseBundleForTests(toml));
34 }
35}
36
View only · write via MCP/CIDE