csharpdeeb25a2 | 1 | using CascadeIDE.Features.CasaField.Application; |
| 2 | using Xunit; |
| 3 | |
| 4 | namespace CascadeIDE.Tests; |
| 5 | |
| 6 | public sealed class KbSectionLineResolverTests |
| 7 | { |
| 8 | [Fact] |
| 9 | public void FindSectionLine_matches_heading() |
| 10 | { |
| 11 | const string md = """ |
| 12 | # Title |
| 13 | |
| 14 | ## Online learning |
| 15 | |
| 16 | Body here. |
| 17 | """; |
| 18 | |
| 19 | var line = KbSectionLineResolver.FindSectionLineInMarkdown(md, "Online learning"); |
| 20 | Assert.Equal(3, line); |
| 21 | } |
| 22 | |
| 23 | [Fact] |
| 24 | public void FindSectionLine_uses_tail_after_slash() |
| 25 | { |
| 26 | const string md = """ |
| 27 | ## Metrics / Compute cost |
| 28 | |
| 29 | Latency metrics. |
| 30 | """; |
| 31 | |
| 32 | var line = KbSectionLineResolver.FindSectionLineInMarkdown(md, "Provenance / Metrics / Compute cost"); |
| 33 | Assert.Equal(1, line); |
| 34 | } |
| 35 | } |
| 36 | |
View only · write via MCP/CIDE