fix(abcip-tests): expression-body KnownProfiles.All to fix static-init NRE
KnownProfiles.All used a { get; } = [...] initialiser declared textually
before the static readonly profile fields it references, so C# static-init
order captured an all-null list. ForFamily() then NRE'd on p.Family, faulting
AbServerFixture..ctor and blocking the whole AbCip.IntegrationTests suite.
Expression-body it so it evaluates on access, after the fields are set.
Live-verified against the controllogix fixture: suite goes 6F/1P/3skip ->
10 pass / 0 fail / 3 skip (skips = emulator-mode tests).
Integration-sweep follow-up #1 (archreview/plans/INTEGRATION-SWEEP-STATUS.md).
This commit is contained in:
@@ -27,7 +27,11 @@ public sealed record AbServerProfile(
|
||||
public static class KnownProfiles
|
||||
{
|
||||
/// <summary>Gets all known server profiles.</summary>
|
||||
public static IReadOnlyList<AbServerProfile> All { get; } =
|
||||
/// <remarks>Expression-bodied (evaluated on access) so it observes the
|
||||
/// <c>static readonly</c> profile fields below after they are initialised;
|
||||
/// a <c>{ get; } =</c> initialiser here runs in textual order — before those
|
||||
/// fields — and would capture an all-null list.</remarks>
|
||||
public static IReadOnlyList<AbServerProfile> All =>
|
||||
[ControlLogix, CompactLogix, Micro800, GuardLogix];
|
||||
|
||||
/// <summary>Gets the ControlLogix profile.</summary>
|
||||
|
||||
Reference in New Issue
Block a user