2026-11-04 07:58:57 +01:00
|
|
|
using AIStudio.Tools;
|
|
|
|
|
using AIStudio.Tools.CodeHighlighting;
|
|
|
|
|
|
|
|
|
|
namespace AIStudio.Tests.Tools.CodeHighlighting;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Checks that every kind of part takes its color from the style sheet of MudBlazor.Markdown, which
|
|
|
|
|
/// colors the code blocks with the palette of the theme.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public sealed class CodeTokenKindExtensionsTests
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public async Task EveryKindHasAClassWhichTheStyleSheetColors([Values] CodeTokenKind kind)
|
|
|
|
|
{
|
|
|
|
|
var styleSheet = await new WebRootFiles().ReadTextAsync("system/MudBlazor.Markdown/MudBlazor.Markdown.min.css");
|
2026-11-04 13:00:56 +01:00
|
|
|
var cssClass = kind.CssClass.Split(' ')[0];
|
2026-11-04 07:58:57 +01:00
|
|
|
|
|
|
|
|
Assert.That(styleSheet, Does.Contain($".{cssClass}"), "A library which renames its classes would leave this kind without color.");
|
|
|
|
|
}
|
|
|
|
|
}
|