mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-04 13:08:23 +08:00
81ce25c34e
* add basic test * fix tests
41 lines
1.4 KiB
C#
41 lines
1.4 KiB
C#
@inherits AntDesignTestBase
|
|
|
|
@code {
|
|
|
|
[Theory]
|
|
[InlineData(BadgeColor.Pink)]
|
|
[InlineData(BadgeColor.Red)]
|
|
[InlineData(BadgeColor.Yellow)]
|
|
[InlineData(BadgeColor.Orange)]
|
|
[InlineData(BadgeColor.Cyan)]
|
|
[InlineData(BadgeColor.Green)]
|
|
[InlineData(BadgeColor.Blue)]
|
|
[InlineData(BadgeColor.Purple)]
|
|
[InlineData(BadgeColor.Geekblue)]
|
|
[InlineData(BadgeColor.Magenta)]
|
|
[InlineData(BadgeColor.Volcano)]
|
|
[InlineData(BadgeColor.Gold)]
|
|
[InlineData(BadgeColor.Lime)]
|
|
public void ItShouldRenderBadgeWithColors(string color)
|
|
{
|
|
var cut = Render<Badge>(@<Badge Color="@color"></Badge> );
|
|
cut.MarkupMatches(@<span class="ant-badge ant-badge-status ant-badge-not-a-wrapper" id:ignore>
|
|
<span class="ant-badge-status-dot" style="background: @color; "></span>
|
|
</span>);
|
|
}
|
|
|
|
[Theory]
|
|
[MemberData(nameof(inlineData))]
|
|
public void ItShouldRenderBadgeWithPresetColors(PresetColor color)
|
|
{
|
|
var cut = Render<Badge>(@<Badge PresetColor="@color"></Badge> );
|
|
var persetColor = Enum.GetName(typeof(PresetColor), color).ToLowerInvariant();
|
|
cut.MarkupMatches(@<span class="ant-badge ant-badge-status ant-badge-not-a-wrapper" id:ignore>
|
|
<span class="ant-badge-status-dot ant-badge-status-@persetColor" style=""></span>
|
|
</span>
|
|
);
|
|
}
|
|
|
|
public static IEnumerable<object[]> inlineData => Enum.GetValues<PresetColor>().Select(x => new object[] { x });
|
|
}
|