Skip to content

Commit f678b4a

Browse files
committed
Fix WebAssemblyHostTest
1 parent 6756170 commit f678b4a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Components/WebAssembly/WebAssembly/test/Hosting/WebAssemblyHostTest.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
using System.Globalization;
55
using System.Text.Json;
6-
using Microsoft.AspNetCore.Components.WebAssembly.Services;
76
using Microsoft.AspNetCore.Testing;
87
using Microsoft.Extensions.DependencyInjection;
8+
using Microsoft.JSInterop;
9+
using Moq;
910

1011
namespace Microsoft.AspNetCore.Components.WebAssembly.Hosting;
1112

@@ -20,6 +21,7 @@ public async Task RunAsync_CanExitBasedOnCancellationToken()
2021
{
2122
// Arrange
2223
var builder = new WebAssemblyHostBuilder(new TestInternalJSImportMethods(), JsonOptions);
24+
builder.Services.AddSingleton(Mock.Of<IJSRuntime>());
2325
var host = builder.Build();
2426
var cultureProvider = new TestSatelliteResourcesLoader();
2527

@@ -39,6 +41,7 @@ public async Task RunAsync_CallingTwiceCausesException()
3941
{
4042
// Arrange
4143
var builder = new WebAssemblyHostBuilder(new TestInternalJSImportMethods(), JsonOptions);
44+
builder.Services.AddSingleton(Mock.Of<IJSRuntime>());
4245
var host = builder.Build();
4346
var cultureProvider = new TestSatelliteResourcesLoader();
4447

@@ -60,6 +63,7 @@ public async Task DisposeAsync_CanDisposeAfterCallingRunAsync()
6063
{
6164
// Arrange
6265
var builder = new WebAssemblyHostBuilder(new TestInternalJSImportMethods(), JsonOptions);
66+
builder.Services.AddSingleton(Mock.Of<IJSRuntime>());
6367
builder.Services.AddSingleton<DisposableService>();
6468
var host = builder.Build();
6569
var cultureProvider = new TestSatelliteResourcesLoader();

src/JSInterop/Microsoft.JSInterop/src/Implementation/JSInProcessObjectReference.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public partial class JSInProcessObjectReference : JSObjectReference, IJSInProces
1515
private readonly JSInProcessRuntime _jsRuntime;
1616

1717
/// <summary>
18-
/// Inititializes a new <see cref="JSInProcessObjectReference"/> instance.
18+
/// Initializes a new <see cref="JSInProcessObjectReference"/> instance.
1919
/// </summary>
2020
/// <param name="jsRuntime">The <see cref="JSInProcessRuntime"/> used for invoking JS interop calls.</param>
2121
/// <param name="id">The unique identifier.</param>

0 commit comments

Comments
 (0)