Skip to content

Commit b6723a6

Browse files
Copilotjaviercn
andcommitted
Move CustomIntSerializer to shared TestContentPackage and register in WebAssembly for E2E tests
Co-authored-by: javiercn <[email protected]>
1 parent 2085568 commit b6723a6

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/Components/test/testassets/BasicTestApp/Program.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using Microsoft.AspNetCore.Components.WebAssembly.Services;
1414
using Microsoft.Extensions.Logging.Configuration;
1515
using Microsoft.JSInterop;
16+
using TestContentPackage;
1617

1718
namespace BasicTestApp;
1819

@@ -45,6 +46,9 @@ public static async Task Main(string[] args)
4546
builder.Services.AddScoped<PreserveStateService>();
4647
builder.Services.AddTransient<FormsTest.ValidationComponentDI.SaladChef>();
4748

49+
// Register custom serializer for E2E testing of persistent component state serialization extensibility
50+
builder.Services.AddSingleton<IPersistentComponentStateSerializer<int>, CustomIntSerializer>();
51+
4852
builder.Services.AddKeyedSingleton("keyed-service-1", TestKeyedService.Create("value-1"));
4953
builder.Services.AddKeyedSingleton(TestServiceKey.ServiceB, TestKeyedService.Create("value-2"));
5054

src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsStartup.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using Microsoft.AspNetCore.Components.Web;
1414
using Microsoft.AspNetCore.Components.WebAssembly.Server;
1515
using Microsoft.AspNetCore.Mvc;
16+
using TestContentPackage;
1617
using TestContentPackage.Services;
1718

1819
namespace TestServer;

src/Components/test/testassets/Components.TestServer/CustomIntSerializer.cs renamed to src/Components/test/testassets/TestContentPackage/CustomIntSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Text;
66
using Microsoft.AspNetCore.Components;
77

8-
namespace TestServer;
8+
namespace TestContentPackage;
99

1010
/// <summary>
1111
/// A custom serializer for int values that uses a custom format to test serialization extensibility.

0 commit comments

Comments
 (0)