513fa1aa16
Comment/XML-doc changes only: - add summaries to ~10k test methods, fixtures, fakes and helpers (+ <param> on theories, <returns> on async Task methods, <inheritdoc/> on interface implementations the checker can resolve) - strip ~2.6k project-tracking references (WP*, P*-*, row-NN, Task N, #NN, Component-0NN) from comments, keeping the explanatory text; reword false positives in comments only - real docs on fakes implementing BCL/library interfaces (IDisposable, ILogger, IOptionsMonitor, IAsyncLifetime) - reword the last 5 src/ false positives (CWE-1236, failures-1, year-0001, M365) Only non-comment edits: four one-line nested classes split across lines so members can carry docs. Build 0 errors / 0 warnings.
42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
using Akka.Actor;
|
|
using ZB.MOM.WW.ScadaBridge.ManagementService;
|
|
|
|
namespace ZB.MOM.WW.ScadaBridge.ManagementService.Tests;
|
|
|
|
/// <summary>
|
|
/// Tests for the <see cref="ManagementActor"/> supervision strategy. The project convention is that long-lived
|
|
/// coordinator-style actors declare an explicit Resume-based strategy.
|
|
/// </summary>
|
|
public class ManagementActorSupervisionTests
|
|
{
|
|
/// <summary>Verifies that the supervisor strategy is a one-for-one strategy.</summary>
|
|
[Fact]
|
|
public void CreateSupervisorStrategy_ReturnsOneForOneStrategy()
|
|
{
|
|
var strategy = ManagementActor.CreateSupervisorStrategy();
|
|
|
|
Assert.IsType<OneForOneStrategy>(strategy);
|
|
}
|
|
|
|
/// <summary>Verifies that the supervisor strategy resumes on an arbitrary exception.</summary>
|
|
[Fact]
|
|
public void CreateSupervisorStrategy_ResumesOnArbitraryException()
|
|
{
|
|
var strategy = (OneForOneStrategy)ManagementActor.CreateSupervisorStrategy();
|
|
|
|
var directive = strategy.Decider.Decide(new InvalidOperationException("boom"));
|
|
|
|
Assert.Equal(Directive.Resume, directive);
|
|
}
|
|
|
|
/// <summary>Verifies that the supervisor strategy resumes indefinitely.</summary>
|
|
[Fact]
|
|
public void CreateSupervisorStrategy_ResumesIndefinitely()
|
|
{
|
|
var strategy = (OneForOneStrategy)ManagementActor.CreateSupervisorStrategy();
|
|
|
|
// Coordinator actors should not give up: unbounded retries.
|
|
Assert.Equal(-1, strategy.MaxNumberOfRetries);
|
|
}
|
|
}
|