test(centralui): register IEndpointVerificationService in OpcUaEndpointEditor/DataConnectionForm fixtures broken by B8 verify-button (T17)
This commit is contained in:
@@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using NSubstitute;
|
||||
using ZB.MOM.WW.ScadaBridge.CentralUI.Services;
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites;
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories;
|
||||
using DataConnectionForm = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Design.DataConnectionForm;
|
||||
@@ -19,6 +20,9 @@ public class DataConnectionFormTests : BunitContext
|
||||
public DataConnectionFormTests()
|
||||
{
|
||||
Services.AddSingleton(_siteRepo);
|
||||
// The OPC UA editor rendered inside the form injects IEndpointVerificationService
|
||||
// (B8 / T17 Verify-endpoint button); a no-op substitute satisfies the injection.
|
||||
Services.AddSingleton<IEndpointVerificationService>(Substitute.For<IEndpointVerificationService>());
|
||||
AddTestAuth();
|
||||
var sites = new List<Site> { new("Plant-A", "plant-a") { Id = 1 } };
|
||||
_siteRepo.GetAllSitesAsync(Arg.Any<CancellationToken>())
|
||||
|
||||
Reference in New Issue
Block a user