< Summary - AsyncResponse (Release / net8.0+net10.0 / unit+integration)

Information
Class: AsyncResponse.Testing.SimulatedCrashException
Assembly: AsyncResponse.Testing
File(s): /_/src/AsyncResponse.Testing/SimulatedCrashException.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 18
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%22100%
get_StepName()100%11100%
get_BeforeStep()100%11100%

File(s)

/_/src/AsyncResponse.Testing/SimulatedCrashException.cs

#LineLine coverage
 1namespace AsyncResponse.Testing;
 2
 3/// <summary>
 4/// The exception <see cref="FlowTestHarness"/> throws from an injected crash point
 5/// (<see cref="FlowTestHarness.CrashBeforeStep"/> / <see cref="FlowTestHarness.CrashAfterStep"/>).
 6/// It rides the executor's ordinary failure path: the execution attempt fails exactly as if the
 7/// process had died at that step boundary, and the next delivery resumes from the last checkpoint.
 8/// Assert on this type to distinguish injected crashes from real test failures.
 9/// </summary>
 10public sealed class SimulatedCrashException(string stepName, bool beforeStep)
 2611    : Exception($"Simulated crash {(beforeStep ? "before" : "after")} step '{stepName}'.")
 12{
 13    /// <summary>The step the crash was injected at.</summary>
 2614    public string StepName { get; } = stepName;
 15
 16    /// <summary>Whether the crash fired before the step executed (<c>true</c>) or after its checkpoint persisted (<c>fa
 2617    public bool BeforeStep { get; } = beforeStep;
 18}