Skip to content

Commit 9203da8

Browse files
committed
test: 增加单元测试
1 parent 1b3a038 commit 9203da8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/UnitTest/Components/LayoutTest.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,22 @@ public async Task TabStyle_Ok()
9393
Assert.True(show);
9494
}
9595

96+
[Fact]
97+
public void OnTabHeaderTextLocalizer_Ok()
98+
{
99+
var cut = Context.RenderComponent<Layout>(pb =>
100+
{
101+
pb.Add(a => a.UseTabSet, true);
102+
pb.Add(a => a.AdditionalAssemblies, new Assembly[] { GetType().Assembly });
103+
pb.Add(a => a.OnTabHeaderTextLocalizer, text => $"Localized-{text}");
104+
});
105+
106+
var nav = cut.Services.GetRequiredService<FakeNavigationManager>();
107+
nav.NavigateTo("/Cat");
108+
109+
cut.Contains("Localized-Cat");
110+
}
111+
96112
[Fact]
97113
public async Task ShowTabInHeader_Ok()
98114
{

0 commit comments

Comments
 (0)