Fix audit findings for coverage, architecture checks, and XML docs
This commit is contained in:
@@ -8,12 +8,18 @@ public class DocumentCollectionIndexApiTests : IDisposable
|
||||
private readonly string _dbPath;
|
||||
private readonly Shared.TestDbContext _db;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DocumentCollectionIndexApiTests"/> class.
|
||||
/// </summary>
|
||||
public DocumentCollectionIndexApiTests()
|
||||
{
|
||||
_dbPath = Path.Combine(Path.GetTempPath(), $"collection_index_api_{Guid.NewGuid():N}.db");
|
||||
_db = new Shared.TestDbContext(_dbPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies vector index creation and deletion behavior.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CreateVectorIndex_And_DropIndex_Should_Work()
|
||||
{
|
||||
@@ -32,6 +38,9 @@ public class DocumentCollectionIndexApiTests : IDisposable
|
||||
_db.VectorItems.GetIndexes().Select(x => x.Name).ShouldNotContain("idx_vector_extra");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies ensure-index returns existing indexes when already present.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void EnsureIndex_Should_Return_Existing_Index_When_Already_Present()
|
||||
{
|
||||
@@ -41,12 +50,18 @@ public class DocumentCollectionIndexApiTests : IDisposable
|
||||
ReferenceEquals(first, second).ShouldBeTrue();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies dropping the primary index name is rejected.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DropIndex_Should_Reject_Primary_Index_Name()
|
||||
{
|
||||
Should.Throw<InvalidOperationException>(() => _db.People.DropIndex("_id"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disposes test resources and removes temporary files.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
_db.Dispose();
|
||||
|
||||
Reference in New Issue
Block a user