45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using Shouldly;
|
|
using Xunit;
|
|
using ZB.MOM.WW.LmxOpcUa.Host;
|
|
using ZB.MOM.WW.LmxOpcUa.Host.Configuration;
|
|
using ZB.MOM.WW.LmxOpcUa.Host.Domain;
|
|
using ZB.MOM.WW.LmxOpcUa.Tests.Helpers;
|
|
|
|
namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
|
|
{
|
|
/// <summary>
|
|
/// Verifies: Start then Stop completes within 30 seconds. (SVC-004)
|
|
/// </summary>
|
|
public class ShutdownCompletesTest
|
|
{
|
|
/// <summary>
|
|
/// Confirms that a started service can shut down within the required time budget.
|
|
/// </summary>
|
|
[Fact]
|
|
public void Shutdown_CompletesWithin30Seconds()
|
|
{
|
|
var config = new AppConfiguration
|
|
{
|
|
OpcUa = new OpcUaConfiguration { Port = 14841, GalaxyName = "TestGalaxy" },
|
|
MxAccess = new MxAccessConfiguration { ClientName = "Test" },
|
|
Dashboard = new DashboardConfiguration { Enabled = false }
|
|
};
|
|
|
|
var proxy = new FakeMxProxy();
|
|
var repo = new FakeGalaxyRepository();
|
|
var service = new OpcUaService(config, proxy, repo);
|
|
|
|
service.Start();
|
|
|
|
var sw = Stopwatch.StartNew();
|
|
service.Stop();
|
|
sw.Stop();
|
|
|
|
sw.Elapsed.TotalSeconds.ShouldBeLessThan(30);
|
|
}
|
|
}
|
|
}
|