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:
@@ -5,12 +5,12 @@ using ZB.MOM.WW.LmxOpcUa.Host.Domain;
|
||||
namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// Verifies default and extended-field behavior for Galaxy attribute metadata objects.
|
||||
/// Verifies default and extended-field behavior for Galaxy attribute metadata objects.
|
||||
/// </summary>
|
||||
public class GalaxyAttributeInfoTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Confirms that a default attribute metadata object starts with empty strings for its text fields.
|
||||
/// Confirms that a default attribute metadata object starts with empty strings for its text fields.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DefaultValues_AreEmpty()
|
||||
@@ -28,7 +28,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that primitive-name and attribute-source fields can be populated for extended metadata rows.
|
||||
/// Confirms that primitive-name and attribute-source fields can be populated for extended metadata rows.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ExtendedFields_CanBeSet()
|
||||
@@ -43,7 +43,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that standard attribute rows leave the extended metadata fields empty.
|
||||
/// Confirms that standard attribute rows leave the extended metadata fields empty.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void StandardAttributes_HaveEmptyExtendedFields()
|
||||
@@ -60,4 +60,4 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
info.AttributeSource.ShouldBe("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,35 +6,35 @@ using ZB.MOM.WW.LmxOpcUa.Host.Domain;
|
||||
namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// Verifies how Galaxy MX data types are mapped into OPC UA and CLR types by the bridge.
|
||||
/// Verifies how Galaxy MX data types are mapped into OPC UA and CLR types by the bridge.
|
||||
/// </summary>
|
||||
public class MxDataTypeMapperTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Confirms that known Galaxy MX data types map to the expected OPC UA data type node identifiers.
|
||||
/// Confirms that known Galaxy MX data types map to the expected OPC UA data type node identifiers.
|
||||
/// </summary>
|
||||
/// <param name="mxDataType">The Galaxy MX data type code.</param>
|
||||
/// <param name="expectedNodeId">The expected OPC UA data type node identifier.</param>
|
||||
[Theory]
|
||||
[InlineData(1, 1u)] // Boolean
|
||||
[InlineData(2, 6u)] // Integer → Int32
|
||||
[InlineData(3, 10u)] // Float
|
||||
[InlineData(4, 11u)] // Double
|
||||
[InlineData(5, 12u)] // String
|
||||
[InlineData(6, 13u)] // DateTime
|
||||
[InlineData(7, 11u)] // ElapsedTime → Double
|
||||
[InlineData(8, 12u)] // Reference → String
|
||||
[InlineData(13, 6u)] // Enumeration → Int32
|
||||
[InlineData(14, 12u)] // Custom → String
|
||||
[InlineData(15, 21u)] // InternationalizedString → LocalizedText
|
||||
[InlineData(16, 12u)] // Custom → String
|
||||
[InlineData(1, 1u)] // Boolean
|
||||
[InlineData(2, 6u)] // Integer → Int32
|
||||
[InlineData(3, 10u)] // Float
|
||||
[InlineData(4, 11u)] // Double
|
||||
[InlineData(5, 12u)] // String
|
||||
[InlineData(6, 13u)] // DateTime
|
||||
[InlineData(7, 11u)] // ElapsedTime → Double
|
||||
[InlineData(8, 12u)] // Reference → String
|
||||
[InlineData(13, 6u)] // Enumeration → Int32
|
||||
[InlineData(14, 12u)] // Custom → String
|
||||
[InlineData(15, 21u)] // InternationalizedString → LocalizedText
|
||||
[InlineData(16, 12u)] // Custom → String
|
||||
public void MapToOpcUaDataType_AllKnownTypes(int mxDataType, uint expectedNodeId)
|
||||
{
|
||||
MxDataTypeMapper.MapToOpcUaDataType(mxDataType).ShouldBe(expectedNodeId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that unknown MX data types default to the OPC UA string data type.
|
||||
/// Confirms that unknown MX data types default to the OPC UA string data type.
|
||||
/// </summary>
|
||||
/// <param name="mxDataType">The unsupported MX data type code.</param>
|
||||
[Theory]
|
||||
@@ -47,7 +47,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that known MX data types map to the expected CLR runtime types.
|
||||
/// Confirms that known MX data types map to the expected CLR runtime types.
|
||||
/// </summary>
|
||||
/// <param name="mxDataType">The Galaxy MX data type code.</param>
|
||||
/// <param name="expectedType">The expected CLR type used by the bridge.</param>
|
||||
@@ -68,7 +68,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that unknown MX data types default to the CLR string type.
|
||||
/// Confirms that unknown MX data types default to the CLR string type.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void MapToClrType_UnknownDefaultsToString()
|
||||
@@ -77,7 +77,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that the boolean MX type reports the expected OPC UA type name.
|
||||
/// Confirms that the boolean MX type reports the expected OPC UA type name.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetOpcUaTypeName_Boolean()
|
||||
@@ -86,7 +86,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that unknown MX types report the fallback OPC UA type name of string.
|
||||
/// Confirms that unknown MX types report the fallback OPC UA type name of string.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetOpcUaTypeName_Unknown_ReturnsString()
|
||||
@@ -94,4 +94,4 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
MxDataTypeMapper.GetOpcUaTypeName(999).ShouldBe("String");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,12 +5,12 @@ using ZB.MOM.WW.LmxOpcUa.Host.Domain;
|
||||
namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// Verifies the operator-facing error messages and quality mappings derived from MXAccess error codes.
|
||||
/// Verifies the operator-facing error messages and quality mappings derived from MXAccess error codes.
|
||||
/// </summary>
|
||||
public class MxErrorCodesTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Confirms that known MXAccess error codes produce readable operator-facing descriptions.
|
||||
/// Confirms that known MXAccess error codes produce readable operator-facing descriptions.
|
||||
/// </summary>
|
||||
/// <param name="code">The MXAccess error code.</param>
|
||||
/// <param name="expectedSubstring">A substring expected in the returned description.</param>
|
||||
@@ -27,7 +27,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that unknown MXAccess error codes are reported as unknown while preserving the numeric code.
|
||||
/// Confirms that unknown MXAccess error codes are reported as unknown while preserving the numeric code.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetMessage_UnknownCode_ReturnsUnknown()
|
||||
@@ -37,7 +37,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that known MXAccess error codes map to the expected bridge quality values.
|
||||
/// Confirms that known MXAccess error codes map to the expected bridge quality values.
|
||||
/// </summary>
|
||||
/// <param name="code">The MXAccess error code.</param>
|
||||
/// <param name="expected">The expected bridge quality value.</param>
|
||||
@@ -54,7 +54,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that unknown MXAccess error codes map to the generic bad quality bucket.
|
||||
/// Confirms that unknown MXAccess error codes map to the generic bad quality bucket.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void MapToQuality_UnknownCode_ReturnsBad()
|
||||
@@ -62,4 +62,4 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
MxErrorCodes.MapToQuality(9999).ShouldBe(Quality.Bad);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,12 +5,12 @@ using ZB.MOM.WW.LmxOpcUa.Host.Domain;
|
||||
namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// Verifies the mapping between MXAccess quality codes, bridge quality values, and OPC UA status codes.
|
||||
/// Verifies the mapping between MXAccess quality codes, bridge quality values, and OPC UA status codes.
|
||||
/// </summary>
|
||||
public class QualityMapperTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Confirms that bad-family MXAccess quality values map to the expected bridge quality values.
|
||||
/// Confirms that bad-family MXAccess quality values map to the expected bridge quality values.
|
||||
/// </summary>
|
||||
/// <param name="input">The raw MXAccess quality code.</param>
|
||||
/// <param name="expected">The bridge quality value expected for the code.</param>
|
||||
@@ -25,7 +25,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that uncertain-family MXAccess quality values map to the expected bridge quality values.
|
||||
/// Confirms that uncertain-family MXAccess quality values map to the expected bridge quality values.
|
||||
/// </summary>
|
||||
/// <param name="input">The raw MXAccess quality code.</param>
|
||||
/// <param name="expected">The bridge quality value expected for the code.</param>
|
||||
@@ -39,7 +39,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that good-family MXAccess quality values map to the expected bridge quality values.
|
||||
/// Confirms that good-family MXAccess quality values map to the expected bridge quality values.
|
||||
/// </summary>
|
||||
/// <param name="input">The raw MXAccess quality code.</param>
|
||||
/// <param name="expected">The bridge quality value expected for the code.</param>
|
||||
@@ -52,7 +52,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that unknown bad-family values collapse to the generic bad quality bucket.
|
||||
/// Confirms that unknown bad-family values collapse to the generic bad quality bucket.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void MapFromMxAccess_UnknownBadValue_ReturnsBad()
|
||||
@@ -61,7 +61,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that unknown uncertain-family values collapse to the generic uncertain quality bucket.
|
||||
/// Confirms that unknown uncertain-family values collapse to the generic uncertain quality bucket.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void MapFromMxAccess_UnknownUncertainValue_ReturnsUncertain()
|
||||
@@ -70,7 +70,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that unknown good-family values collapse to the generic good quality bucket.
|
||||
/// Confirms that unknown good-family values collapse to the generic good quality bucket.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void MapFromMxAccess_UnknownGoodValue_ReturnsGood()
|
||||
@@ -79,7 +79,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that the generic good quality maps to the OPC UA good status code.
|
||||
/// Confirms that the generic good quality maps to the OPC UA good status code.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void MapToOpcUa_Good_Returns0()
|
||||
@@ -88,7 +88,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that the generic bad quality maps to the OPC UA bad status code.
|
||||
/// Confirms that the generic bad quality maps to the OPC UA bad status code.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void MapToOpcUa_Bad_Returns80000000()
|
||||
@@ -97,7 +97,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that communication failures map to the OPC UA bad communication-failure status code.
|
||||
/// Confirms that communication failures map to the OPC UA bad communication-failure status code.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void MapToOpcUa_BadCommFailure()
|
||||
@@ -106,7 +106,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that the generic uncertain quality maps to the OPC UA uncertain status code.
|
||||
/// Confirms that the generic uncertain quality maps to the OPC UA uncertain status code.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void MapToOpcUa_Uncertain()
|
||||
@@ -115,7 +115,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that good quality values are classified correctly by the quality extension helpers.
|
||||
/// Confirms that good quality values are classified correctly by the quality extension helpers.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QualityExtensions_IsGood()
|
||||
@@ -126,7 +126,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that bad quality values are classified correctly by the quality extension helpers.
|
||||
/// Confirms that bad quality values are classified correctly by the quality extension helpers.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QualityExtensions_IsBad()
|
||||
@@ -136,7 +136,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that uncertain quality values are classified correctly by the quality extension helpers.
|
||||
/// Confirms that uncertain quality values are classified correctly by the quality extension helpers.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QualityExtensions_IsUncertain()
|
||||
@@ -146,4 +146,4 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
Quality.Uncertain.IsBad().ShouldBe(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,22 +7,22 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
public class SecurityClassificationMapperTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Verifies that Galaxy classifications intended for operator and engineering writes remain writable through OPC UA.
|
||||
/// Verifies that Galaxy classifications intended for operator and engineering writes remain writable through OPC UA.
|
||||
/// </summary>
|
||||
/// <param name="classification">The Galaxy security classification value being evaluated for write access.</param>
|
||||
/// <param name="expected">The expected writable result for the supplied Galaxy classification.</param>
|
||||
[Theory]
|
||||
[InlineData(0, true)] // FreeAccess
|
||||
[InlineData(1, true)] // Operate
|
||||
[InlineData(4, true)] // Tune
|
||||
[InlineData(5, true)] // Configure
|
||||
[InlineData(0, true)] // FreeAccess
|
||||
[InlineData(1, true)] // Operate
|
||||
[InlineData(4, true)] // Tune
|
||||
[InlineData(5, true)] // Configure
|
||||
public void Writable_SecurityLevels(int classification, bool expected)
|
||||
{
|
||||
SecurityClassificationMapper.IsWritable(classification).ShouldBe(expected);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that secured or view-only Galaxy classifications are exposed as read-only attributes.
|
||||
/// Verifies that secured or view-only Galaxy classifications are exposed as read-only attributes.
|
||||
/// </summary>
|
||||
/// <param name="classification">The Galaxy security classification value expected to block writes.</param>
|
||||
/// <param name="expected">The expected writable result for the supplied read-only Galaxy classification.</param>
|
||||
@@ -36,9 +36,12 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that unknown security classifications do not accidentally block writes for unmapped Galaxy values.
|
||||
/// Verifies that unknown security classifications do not accidentally block writes for unmapped Galaxy values.
|
||||
/// </summary>
|
||||
/// <param name="classification">An unmapped Galaxy security classification value that should fall back to writable behavior.</param>
|
||||
/// <param name="classification">
|
||||
/// An unmapped Galaxy security classification value that should fall back to writable
|
||||
/// behavior.
|
||||
/// </param>
|
||||
[Theory]
|
||||
[InlineData(-1)]
|
||||
[InlineData(7)]
|
||||
@@ -48,4 +51,4 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
|
||||
SecurityClassificationMapper.IsWritable(classification).ShouldBeTrue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user