Fix audit findings for coverage, architecture checks, and XML docs
All checks were successful
NuGet Publish / build-and-pack (push) Successful in 45s
NuGet Publish / publish-to-gitea (push) Successful in 52s

This commit is contained in:
Joseph Doherty
2026-02-20 15:43:25 -05:00
parent 5528806518
commit 3ffd468c79
99 changed files with 23746 additions and 9548 deletions

View File

@@ -13,6 +13,9 @@ namespace ZB.MOM.WW.CBDD.Tests
private readonly System.Collections.Concurrent.ConcurrentDictionary<string, ushort> _keyMap = new(StringComparer.OrdinalIgnoreCase);
private readonly System.Collections.Concurrent.ConcurrentDictionary<ushort, string> _keys = new();
/// <summary>
/// Initializes lookup maps used by attribute mapper tests.
/// </summary>
public AttributeTests()
{
ushort id = 1;
@@ -25,6 +28,9 @@ namespace ZB.MOM.WW.CBDD.Tests
}
}
/// <summary>
/// Verifies table attribute mapping resolves the expected collection name.
/// </summary>
[Fact]
public void Test_Table_Attribute_Mapping()
{
@@ -33,6 +39,9 @@ namespace ZB.MOM.WW.CBDD.Tests
mapper.CollectionName.ShouldBe("test.custom_users");
}
/// <summary>
/// Verifies required attribute validation is enforced.
/// </summary>
[Fact]
public void Test_Required_Validation()
{
@@ -52,6 +61,9 @@ namespace ZB.MOM.WW.CBDD.Tests
thrown.ShouldBeTrue("Should throw ValidationException for empty Name.");
}
/// <summary>
/// Verifies string length attribute validation is enforced.
/// </summary>
[Fact]
public void Test_StringLength_Validation()
{
@@ -69,6 +81,9 @@ namespace ZB.MOM.WW.CBDD.Tests
thrown.ShouldBeTrue("Should throw ValidationException for Name too long.");
}
/// <summary>
/// Verifies range attribute validation is enforced.
/// </summary>
[Fact]
public void Test_Range_Validation()
{
@@ -81,6 +96,9 @@ namespace ZB.MOM.WW.CBDD.Tests
thrown.ShouldBeTrue("Should throw ValidationException for Age out of range.");
}
/// <summary>
/// Verifies column attribute maps to the expected BSON field name.
/// </summary>
[Fact]
public void Test_Column_Name_Mapping()
{
@@ -108,6 +126,9 @@ namespace ZB.MOM.WW.CBDD.Tests
foundDisplayName.ShouldBeTrue("BSON field name should be 'display_name' from [Column] attribute.");
}
/// <summary>
/// Verifies not-mapped attribute excludes properties from BSON serialization.
/// </summary>
[Fact]
public void Test_NotMapped_Attribute()
{