File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 44// Maintainer: Argo Zhang([email protected] ) Website: https://www.blazor.zone 55
66using Microsoft . Extensions . Options ;
7+ using System . Collections . Frozen ;
78
89namespace UnitTest . Services ;
910
@@ -33,11 +34,12 @@ public void ConfigureIconMapperOptions_Ok()
3334 context . Services . AddOptionsMonitor < IconThemeOptions > ( ) ;
3435 context . Services . ConfigureIconThemeOptions ( options =>
3536 {
36- options . ThemeKey = "mock" ;
37- options . Icons [ "mock" ] = new ( )
37+ var icons = new Dictionary < ComponentIcons , string > ( )
3838 {
3939 { ComponentIcons . AnchorLinkIcon , "mdi mdi-link-variant" }
4040 } ;
41+ options . TryAddIcons ( "mock" , icons . ToFrozenDictionary ( ) ) ;
42+ options . ThemeKey = "mock" ;
4143 } ) ;
4244
4345 var iconService = context . Services . GetRequiredService < IIconTheme > ( ) ;
@@ -57,11 +59,11 @@ internal class MockIconTheme(IOptions<IconThemeOptions> options) : IIconTheme
5759 /// <inheritdoc/>
5860 /// </summary>
5961 /// <returns></returns>
60- public Dictionary < ComponentIcons , string > GetIcons ( )
62+ public FrozenDictionary < ComponentIcons , string > GetIcons ( )
6163 {
6264 if ( ! Options . Value . Icons . TryGetValue ( Options . Value . ThemeKey , out var icons ) )
6365 {
64- icons = [ ] ;
66+ icons = FrozenDictionary < ComponentIcons , string > . Empty ;
6567 }
6668 return icons ;
6769 }
You can’t perform that action at this time.
0 commit comments