mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-07 00:39:00 +08:00
- 实现 RichTextEffectBase 基类提供统一的标签命名和参数读取逻辑 - 添加 RichTextBlueEffect、RichTextGoldEffect、RichTextGreenEffect 和 RichTextRedEffect 颜色标记效果 - 添加 RichTextFadeInEffect、RichTextFlyInEffect、RichTextJitterEffect 和 RichTextSineEffect 动画效果 - 实现 DefaultRichTextEffectRegistry 默认效果注册表 - 创建 GfRichTextLabel 富文本标签宿主组件 - 添加 IRichTextEffectRegistry 效果注册表接口 - 实现 RichTextEffectEntry、RichTextEffectsController 和 RichTextProfile 配置管理类 - 添加 RichTextMarkup 语义化标签构建辅助方法 - 创建 RichTextMarkupTests 和 RichTextProfileTests 单元测试
32 lines
777 B
C#
32 lines
777 B
C#
using GFramework.Godot.Text;
|
|
|
|
namespace GFramework.Godot.Tests.Text;
|
|
|
|
/// <summary>
|
|
/// <see cref="RichTextProfile" /> 的测试。
|
|
/// </summary>
|
|
[TestFixture]
|
|
public sealed class RichTextProfileTests
|
|
{
|
|
/// <summary>
|
|
/// 验证默认内置配置会暴露完整的第一阶段效果键集合。
|
|
/// </summary>
|
|
[Test]
|
|
public void CreateBuiltInDefault_Should_Contain_The_First_Phase_Effect_Keys()
|
|
{
|
|
var profile = RichTextProfile.CreateBuiltInDefault();
|
|
|
|
Assert.That(profile.Effects.Select(static entry => entry.Key), Is.EqualTo(new[]
|
|
{
|
|
"green",
|
|
"red",
|
|
"gold",
|
|
"blue",
|
|
"fade_in",
|
|
"sine",
|
|
"jitter",
|
|
"fly_in"
|
|
}));
|
|
}
|
|
}
|