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 @@ public class DocumentCollectionTests : IDisposable
private readonly string _walPath;
private readonly Shared.TestDbContext _db;
/// <summary>
/// Initializes a new instance of the <see cref="DocumentCollectionTests"/> class.
/// </summary>
public DocumentCollectionTests()
{
_dbPath = Path.Combine(Path.GetTempPath(), $"test_collection_{Guid.NewGuid()}.db");
@@ -21,6 +24,9 @@ public class DocumentCollectionTests : IDisposable
_db = new Shared.TestDbContext(_dbPath);
}
/// <summary>
/// Verifies insert and find-by-id operations.
/// </summary>
[Fact]
public void Insert_And_FindById_Works()
{
@@ -39,6 +45,9 @@ public class DocumentCollectionTests : IDisposable
found.Age.ShouldBe(30);
}
/// <summary>
/// Verifies find-by-id returns null when no document is found.
/// </summary>
[Fact]
public void FindById_Returns_Null_When_Not_Found()
{
@@ -49,6 +58,9 @@ public class DocumentCollectionTests : IDisposable
found.ShouldBeNull();
}
/// <summary>
/// Verifies find-all returns all entities.
/// </summary>
[Fact]
public void FindAll_Returns_All_Entities()
{
@@ -68,6 +80,9 @@ public class DocumentCollectionTests : IDisposable
all.ShouldContain(u => u.Name == "Charlie");
}
/// <summary>
/// Verifies update modifies an existing entity.
/// </summary>
[Fact]
public void Update_Modifies_Entity()
{
@@ -89,6 +104,9 @@ public class DocumentCollectionTests : IDisposable
found.Age.ShouldBe(31);
}
/// <summary>
/// Verifies update returns false when the entity does not exist.
/// </summary>
[Fact]
public void Update_Returns_False_When_Not_Found()
{
@@ -103,6 +121,9 @@ public class DocumentCollectionTests : IDisposable
updated.ShouldBeFalse();
}
/// <summary>
/// Verifies delete removes an entity.
/// </summary>
[Fact]
public void Delete_Removes_Entity()
{
@@ -120,6 +141,9 @@ public class DocumentCollectionTests : IDisposable
_db.Users.FindById(id).ShouldBeNull();
}
/// <summary>
/// Verifies delete returns false when the entity does not exist.
/// </summary>
[Fact]
public void Delete_Returns_False_When_Not_Found()
{
@@ -131,6 +155,9 @@ public class DocumentCollectionTests : IDisposable
deleted.ShouldBeFalse();
}
/// <summary>
/// Verifies count returns the correct entity count.
/// </summary>
[Fact]
public void Count_Returns_Correct_Count()
{
@@ -146,6 +173,9 @@ public class DocumentCollectionTests : IDisposable
count.ShouldBe(2);
}
/// <summary>
/// Verifies predicate queries filter entities correctly.
/// </summary>
[Fact]
public void Find_With_Predicate_Filters_Correctly()
{
@@ -163,6 +193,9 @@ public class DocumentCollectionTests : IDisposable
over30[0].Name.ShouldBe("Charlie");
}
/// <summary>
/// Verifies bulk insert stores multiple entities.
/// </summary>
[Fact]
public void InsertBulk_Inserts_Multiple_Entities()
{
@@ -183,6 +216,9 @@ public class DocumentCollectionTests : IDisposable
_db.Users.Count().ShouldBe(3);
}
/// <summary>
/// Verifies inserts preserve an explicitly assigned identifier.
/// </summary>
[Fact]
public void Insert_With_SpecifiedId_RetainsId()
{
@@ -203,6 +239,9 @@ public class DocumentCollectionTests : IDisposable
found.Name.ShouldBe("SpecifiedID");
}
/// <summary>
/// Releases test resources.
/// </summary>
public void Dispose()
{
_db?.Dispose();