// Copyright (c) Microsoft. All rights reserved. using Pinecone.ConformanceTests.Support; using VectorData.ConformanceTests; using VectorData.ConformanceTests.Support; using Xunit; namespace Pinecone.ConformanceTests; public class PineconeDistanceFunctionTests(PineconeDistanceFunctionTests.Fixture fixture) : DistanceFunctionTests(fixture), IClassFixture { public override Task CosineDistance() => Assert.ThrowsAsync(base.CosineDistance); public override Task EuclideanDistance() => Assert.ThrowsAsync(base.EuclideanDistance); public override Task HammingDistance() => Assert.ThrowsAsync(base.HammingDistance); public override Task ManhattanDistance() => Assert.ThrowsAsync(base.ManhattanDistance); public override Task NegativeDotProductSimilarity() => Assert.ThrowsAsync(base.NegativeDotProductSimilarity); protected override async Task Test( string distanceFunction, double expectedExactMatchScore, double expectedOppositeScore, double expectedOrthogonalScore, int[] resultOrder) { await base.Test( distanceFunction, expectedExactMatchScore, expectedOppositeScore, expectedOrthogonalScore, resultOrder); // The Pinecone emulator needs some extra time to spawn a new index service // that uses a different distance function. await Task.Delay(TimeSpan.FromSeconds(5)); } public new class Fixture() : DistanceFunctionTests.Fixture { public override TestStore TestStore => PineconeTestStore.Instance; } }