Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/MudBlazor.Markdown/Services/MudMarkdownValueProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ namespace MudBlazor;

internal sealed class MudMarkdownValueProvider : IMudMarkdownValueProvider
{
private readonly IMemoryCache _memoryCache;
private readonly IMudMarkdownMemoryCache _memoryCache;
private readonly MemoryCacheEntryOptions _memoryCacheEntryOptions;
private static readonly HttpClient HttpClient = new();

public MudMarkdownValueProvider(IMemoryCache memoryCache, IOptions<MudMarkdownMemoryCacheEntryOptions> options)
public MudMarkdownValueProvider(IMudMarkdownMemoryCache memoryCache, IOptions<MudMarkdownMemoryCacheEntryOptions> options)
{
_memoryCache = memoryCache;
_memoryCacheEntryOptions = options.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,28 @@ public void RegisterScopedMemoryCache()
.Should()
.NotBe(scopedInstance);
}

[Fact]
public void RegisterServices()
{
using var serviceProvider = new ServiceCollection()
.AddMudMarkdownServices()
.BuildServiceProvider();

serviceProvider.GetRequiredService<IMudMarkdownMemoryCache>()
.Should()
.BeOfType<MudMarkdownMemoryCache>();

serviceProvider.GetService<IMemoryCache>()
.Should()
.BeNull();

serviceProvider.GetRequiredService<IMudMarkdownThemeService>()
.Should()
.BeOfType<MudMarkdownThemeService>();

serviceProvider.GetRequiredService<IMudMarkdownValueProvider>()
.Should()
.BeOfType<MudMarkdownValueProvider>();
}
}