Skip to content

Commit 3ed83cd

Browse files
committed
test: 更新单元测试
1 parent 1a3b1f6 commit 3ed83cd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/UnitTest/Services/ThemeProviderTest.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@ public class ThemeProviderTest : BootstrapBlazorTestBase
1010
[Fact]
1111
public async Task SetTheme_Ok()
1212
{
13+
var themeName = "";
1314
var themeProviderService = Context.Services.GetRequiredService<IThemeProvider>();
15+
themeProviderService.ThemeChangedAsync = async theme =>
16+
{
17+
themeName = theme;
18+
await Task.CompletedTask;
19+
};
1420
await themeProviderService.SetThemeAsync("light");
21+
Assert.Equal("light", themeName);
1522
}
1623

1724
[Fact]

0 commit comments

Comments
 (0)