Skip to content

Commit fdaf61d

Browse files
committed
Refactor benchmarks: Add missing using directives, make Cases public, and update mock service registrations for consistency and enhanced test coverage.
1 parent def63c6 commit fdaf61d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

benchmarks/Benchmarks.InfiniBlazor.Markdown/IndividualMarkdownBenchmarks.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
using BenchmarkDotNet.Order;
66
using InfiniBlazor.Markdown;
77
using InfiniBlazor.Markdown.Syntax;
8+
using Microsoft.AspNetCore.Components;
89
using Microsoft.Extensions.DependencyInjection;
10+
using Microsoft.JSInterop;
911
using System.Text;
1012

1113
namespace Benchmarks.InfiniBlazor.Markdown;
@@ -20,8 +22,8 @@ public class IndividualMarkdownBenchmarks {
2022
[GlobalSetup]
2123
public void Setup() {
2224
var serviceCollection = new ServiceCollection();
23-
serviceCollection.AddSingleton<Microsoft.AspNetCore.Components.NavigationManager, MockNavigationManager>();
24-
serviceCollection.AddSingleton<Microsoft.JSInterop.IJSRuntime, MockJsRuntime>();
25+
serviceCollection.AddSingleton<NavigationManager, MockNavigationManager>();
26+
serviceCollection.AddSingleton<IJSRuntime, MockJsRuntime>();
2527
serviceCollection.AddInfiniBlazor();
2628
serviceCollection.AddLogging();
2729
ServiceProvider provider = serviceCollection.BuildServiceProvider();
@@ -42,7 +44,7 @@ public sealed record BenchmarkCase(string Name, string Markdown) {
4244
// -----------------------------------------------------------------------------------------------------------------
4345
// Data
4446
// -----------------------------------------------------------------------------------------------------------------
45-
private static IEnumerable<BenchmarkCase> Cases => [
47+
public static IEnumerable<BenchmarkCase> Cases => [
4648
new("Paragraph_Base", "This is a paragraph."),// baseline
4749

4850
#region BlockQuote

0 commit comments

Comments
 (0)