Apply code style formatting and restore partial modifiers on Avalonia views

Linter/formatter pass across the full codebase. Restores required partial
keyword on AXAML code-behind classes that the formatter incorrectly removed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-03-31 07:58:13 -04:00
parent 55ef854612
commit 41a6b66943
221 changed files with 4274 additions and 3823 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Threading;
using Shouldly;
using Xunit;
using ZB.MOM.WW.LmxOpcUa.Host.Metrics;
@@ -6,12 +7,12 @@ using ZB.MOM.WW.LmxOpcUa.Host.Metrics;
namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
{
/// <summary>
/// Verifies operation timing aggregation, rolling buffers, and success tracking used by the bridge metrics subsystem.
/// Verifies operation timing aggregation, rolling buffers, and success tracking used by the bridge metrics subsystem.
/// </summary>
public class PerformanceMetricsTests
{
/// <summary>
/// Confirms that a fresh metrics collector reports no statistics.
/// Confirms that a fresh metrics collector reports no statistics.
/// </summary>
[Fact]
public void EmptyState_ReturnsZeroStatistics()
@@ -22,13 +23,13 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
}
/// <summary>
/// Confirms that repeated operation recordings update total and successful execution counts.
/// Confirms that repeated operation recordings update total and successful execution counts.
/// </summary>
[Fact]
public void RecordOperation_TracksCounts()
{
using var metrics = new PerformanceMetrics();
metrics.RecordOperation("Read", TimeSpan.FromMilliseconds(10), true);
metrics.RecordOperation("Read", TimeSpan.FromMilliseconds(10));
metrics.RecordOperation("Read", TimeSpan.FromMilliseconds(20), false);
var stats = metrics.GetStatistics();
@@ -39,7 +40,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
}
/// <summary>
/// Confirms that min, max, and average timing values are calculated from recorded operations.
/// Confirms that min, max, and average timing values are calculated from recorded operations.
/// </summary>
[Fact]
public void RecordOperation_TracksMinMaxAverage()
@@ -56,13 +57,13 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
}
/// <summary>
/// Confirms that the 95th percentile is calculated from the recorded timing sample.
/// Confirms that the 95th percentile is calculated from the recorded timing sample.
/// </summary>
[Fact]
public void P95_CalculatedCorrectly()
{
using var metrics = new PerformanceMetrics();
for (int i = 1; i <= 100; i++)
for (var i = 1; i <= 100; i++)
metrics.RecordOperation("Op", TimeSpan.FromMilliseconds(i));
var stats = metrics.GetStatistics()["Op"];
@@ -70,13 +71,13 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
}
/// <summary>
/// Confirms that the rolling buffer keeps the most recent operation durations for percentile calculations.
/// Confirms that the rolling buffer keeps the most recent operation durations for percentile calculations.
/// </summary>
[Fact]
public void RollingBuffer_EvictsOldEntries()
{
var opMetrics = new OperationMetrics();
for (int i = 0; i < 1100; i++)
for (var i = 0; i < 1100; i++)
opMetrics.Record(TimeSpan.FromMilliseconds(i), true);
var stats = opMetrics.GetStatistics();
@@ -86,7 +87,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
}
/// <summary>
/// Confirms that a timing scope records an operation when disposed.
/// Confirms that a timing scope records an operation when disposed.
/// </summary>
[Fact]
public void BeginOperation_TimingScopeRecordsOnDispose()
@@ -96,7 +97,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
using (var scope = metrics.BeginOperation("Test"))
{
// Simulate some work
System.Threading.Thread.Sleep(5);
Thread.Sleep(5);
}
var stats = metrics.GetStatistics();
@@ -107,7 +108,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
}
/// <summary>
/// Confirms that a timing scope can mark an operation as failed before disposal.
/// Confirms that a timing scope can mark an operation as failed before disposal.
/// </summary>
[Fact]
public void BeginOperation_SetSuccessFalse()
@@ -125,7 +126,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
}
/// <summary>
/// Confirms that looking up an unknown operation returns no metrics bucket.
/// Confirms that looking up an unknown operation returns no metrics bucket.
/// </summary>
[Fact]
public void GetMetrics_UnknownOperation_ReturnsNull()
@@ -135,7 +136,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
}
/// <summary>
/// Confirms that operation names are tracked without case sensitivity.
/// Confirms that operation names are tracked without case sensitivity.
/// </summary>
[Fact]
public void OperationNames_AreCaseInsensitive()
@@ -149,4 +150,4 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
stats["READ"].TotalCount.ShouldBe(2);
}
}
}
}