File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
src/MudBlazor.Markdown/Services
tests/MudBlazor.Markdown.Tests/Utils/ServiceCollectionExTests Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ namespace MudBlazor;
44
55internal sealed class MudMarkdownValueProvider : IMudMarkdownValueProvider
66{
7- private readonly IMemoryCache _memoryCache ;
7+ private readonly IMudMarkdownMemoryCache _memoryCache ;
88 private readonly MemoryCacheEntryOptions _memoryCacheEntryOptions ;
99 private static readonly HttpClient HttpClient = new ( ) ;
1010
11- public MudMarkdownValueProvider ( IMemoryCache memoryCache , IOptions < MudMarkdownMemoryCacheEntryOptions > options )
11+ public MudMarkdownValueProvider ( IMudMarkdownMemoryCache memoryCache , IOptions < MudMarkdownMemoryCacheEntryOptions > options )
1212 {
1313 _memoryCache = memoryCache ;
1414 _memoryCacheEntryOptions = options . Value ;
Original file line number Diff line number Diff line change @@ -59,4 +59,28 @@ public void RegisterScopedMemoryCache()
5959 . Should ( )
6060 . NotBe ( scopedInstance ) ;
6161 }
62+
63+ [ Fact ]
64+ public void RegisterServices ( )
65+ {
66+ using var serviceProvider = new ServiceCollection ( )
67+ . AddMudMarkdownServices ( )
68+ . BuildServiceProvider ( ) ;
69+
70+ serviceProvider . GetRequiredService < IMudMarkdownMemoryCache > ( )
71+ . Should ( )
72+ . BeOfType < MudMarkdownMemoryCache > ( ) ;
73+
74+ serviceProvider . GetService < IMemoryCache > ( )
75+ . Should ( )
76+ . BeNull ( ) ;
77+
78+ serviceProvider . GetRequiredService < IMudMarkdownThemeService > ( )
79+ . Should ( )
80+ . BeOfType < MudMarkdownThemeService > ( ) ;
81+
82+ serviceProvider . GetRequiredService < IMudMarkdownValueProvider > ( )
83+ . Should ( )
84+ . BeOfType < MudMarkdownValueProvider > ( ) ;
85+ }
6286}
You can’t perform that action at this time.
0 commit comments