diff --git a/.gitignore b/.gitignore
index fe14c1529238..0cd023b42145 100644
--- a/.gitignore
+++ b/.gitignore
@@ -502,3 +502,5 @@ swa-cli.config.json
# dapr extension files
**/dapr.yaml
+
+*.lscache
\ No newline at end of file
diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.props
index 95db60cb6f98..d4e4df0a09cd 100644
--- a/dotnet/Directory.Packages.props
+++ b/dotnet/Directory.Packages.props
@@ -92,7 +92,7 @@
-
+
@@ -110,8 +110,8 @@
-
-
+
+
@@ -120,18 +120,18 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -139,20 +139,22 @@
-
+
-
+
+
+
-
+
diff --git a/dotnet/MEVD.slnf b/dotnet/MEVD.slnf
index 2a2273ba7f88..afdb2c76b516 100644
--- a/dotnet/MEVD.slnf
+++ b/dotnet/MEVD.slnf
@@ -18,7 +18,6 @@
"src/VectorData/SqlServer/SqlServer.csproj",
"src/VectorData/Weaviate/Weaviate.csproj",
- "src/VectorData/VectorData.Abstractions/VectorData.Abstractions.csproj",
"test/VectorData/AzureAISearch.UnitTests/AzureAISearch.UnitTests.csproj",
"test/VectorData/AzureAISearch.ConformanceTests/AzureAISearch.ConformanceTests.csproj",
@@ -42,9 +41,7 @@
"test/VectorData/SqliteVec.ConformanceTests/SqliteVec.ConformanceTests.csproj",
"test/VectorData/SqlServer.ConformanceTests/SqlServer.ConformanceTests.csproj",
"test/VectorData/Weaviate.UnitTests/Weaviate.UnitTests.csproj",
- "test/VectorData/Weaviate.ConformanceTests/Weaviate.ConformanceTests.csproj",
-
- "test/VectorData/VectorData.ConformanceTests/VectorData.ConformanceTests.csproj"
+ "test/VectorData/Weaviate.ConformanceTests/Weaviate.ConformanceTests.csproj"
]
}
}
\ No newline at end of file
diff --git a/dotnet/SK-dotnet.slnx b/dotnet/SK-dotnet.slnx
index b2ff323d726c..faf9169ec443 100644
--- a/dotnet/SK-dotnet.slnx
+++ b/dotnet/SK-dotnet.slnx
@@ -136,7 +136,6 @@
-
@@ -316,8 +315,6 @@
-
-
diff --git a/dotnet/SK-release.slnf b/dotnet/SK-release.slnf
index 1b497da3f66e..78ee739f7407 100644
--- a/dotnet/SK-release.slnf
+++ b/dotnet/SK-release.slnf
@@ -45,7 +45,6 @@
"src\\VectorData\\Redis\\Redis.csproj",
"src\\VectorData\\SqliteVec\\SqliteVec.csproj",
"src\\VectorData\\SqlServer\\SqlServer.csproj",
- "src\\VectorData\\VectorData.Abstractions\\VectorData.Abstractions.csproj",
"src\\VectorData\\Weaviate\\Weaviate.csproj",
"src\\Experimental\\Orchestration.Flow\\Experimental.Orchestration.Flow.csproj",
diff --git a/dotnet/src/InternalUtilities/connectors/Memory/MongoDB/MongoModelBuilder.cs b/dotnet/src/InternalUtilities/connectors/Memory/MongoDB/MongoModelBuilder.cs
index 25b77f90839b..0e51c5340921 100644
--- a/dotnet/src/InternalUtilities/connectors/Memory/MongoDB/MongoModelBuilder.cs
+++ b/dotnet/src/InternalUtilities/connectors/Memory/MongoDB/MongoModelBuilder.cs
@@ -27,9 +27,9 @@ internal class MongoModelBuilder() : CollectionModelBuilder(s_validationOptions)
UsesExternalSerializer = true,
};
- protected override void ProcessProperty(PropertyInfo? clrProperty, VectorStoreProperty? definitionProperty, Type? type)
+ protected override void ProcessProperty(PropertyInfo? clrProperty, VectorStoreProperty? definitionProperty)
{
- base.ProcessProperty(clrProperty, definitionProperty, type);
+ base.ProcessProperty(clrProperty, definitionProperty);
if (clrProperty?.GetCustomAttribute() is { } bsonElementAttribute
&& this.PropertyMap.TryGetValue(clrProperty.Name, out var property))
diff --git a/dotnet/src/SemanticKernel.Abstractions/SemanticKernel.Abstractions.csproj b/dotnet/src/SemanticKernel.Abstractions/SemanticKernel.Abstractions.csproj
index 02b5009b6194..78d70f6bd2a7 100644
--- a/dotnet/src/SemanticKernel.Abstractions/SemanticKernel.Abstractions.csproj
+++ b/dotnet/src/SemanticKernel.Abstractions/SemanticKernel.Abstractions.csproj
@@ -24,7 +24,7 @@
-
+
diff --git a/dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchKernelBuilderExtensions.cs b/dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchKernelBuilderExtensions.cs
index 84909b8229c9..fa421d45a2bf 100644
--- a/dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchKernelBuilderExtensions.cs
+++ b/dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchKernelBuilderExtensions.cs
@@ -24,6 +24,7 @@ public static class TextSearchKernelBuilderExtensions
ITextSearchResultMapper? resultMapper = null,
VectorStoreTextSearchOptions? options = null,
string? serviceId = default)
+ where TRecord : class
{
builder.Services.AddVectorStoreTextSearch(stringMapper, resultMapper, options, serviceId);
return builder;
diff --git a/dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchServiceCollectionExtensions.cs b/dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchServiceCollectionExtensions.cs
index 950cb46777af..5a60592cce25 100644
--- a/dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchServiceCollectionExtensions.cs
+++ b/dotnet/src/SemanticKernel.Core/Data/TextSearch/TextSearchServiceCollectionExtensions.cs
@@ -28,6 +28,7 @@ public static class TextSearchServiceCollectionExtensions
ITextSearchResultMapper? resultMapper = null,
VectorStoreTextSearchOptions? options = null,
string? serviceId = default)
+ where TRecord : class
{
// If we are not constructing the dependent services, add the VectorStoreTextSearch as transient, since we
// cannot make assumptions about how dependent services are being managed.
diff --git a/dotnet/src/SemanticKernel.Core/Data/TextSearch/VectorStoreTextSearch.cs b/dotnet/src/SemanticKernel.Core/Data/TextSearch/VectorStoreTextSearch.cs
index c83bdbcbddb9..eb26852881ce 100644
--- a/dotnet/src/SemanticKernel.Core/Data/TextSearch/VectorStoreTextSearch.cs
+++ b/dotnet/src/SemanticKernel.Core/Data/TextSearch/VectorStoreTextSearch.cs
@@ -21,6 +21,7 @@ namespace Microsoft.SemanticKernel.Data;
[Experimental("SKEXP0001")]
#pragma warning disable CS0618 // ITextSearch is obsolete
public sealed class VectorStoreTextSearch<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] TRecord> : ITextSearch, ITextSearch
+ where TRecord : class
#pragma warning restore CS0618
#pragma warning restore CA1711 // Identifiers should not have incorrect suffix
{
diff --git a/dotnet/src/VectorData/AzureAISearch/AzureAISearch.csproj b/dotnet/src/VectorData/AzureAISearch/AzureAISearch.csproj
index d43078f48cee..b1691a79cd3e 100644
--- a/dotnet/src/VectorData/AzureAISearch/AzureAISearch.csproj
+++ b/dotnet/src/VectorData/AzureAISearch/AzureAISearch.csproj
@@ -31,14 +31,11 @@
+
-
-
-
-
diff --git a/dotnet/src/VectorData/CosmosMongoDB/CosmosMongoDB.csproj b/dotnet/src/VectorData/CosmosMongoDB/CosmosMongoDB.csproj
index 52b98d55b40e..f2c40021388b 100644
--- a/dotnet/src/VectorData/CosmosMongoDB/CosmosMongoDB.csproj
+++ b/dotnet/src/VectorData/CosmosMongoDB/CosmosMongoDB.csproj
@@ -28,22 +28,15 @@
-
-
-
-
-
+
-
-
-
-
+
diff --git a/dotnet/src/VectorData/CosmosNoSql/CosmosNoSql.csproj b/dotnet/src/VectorData/CosmosNoSql/CosmosNoSql.csproj
index 2849a25f118e..cbfbc8beebf4 100644
--- a/dotnet/src/VectorData/CosmosNoSql/CosmosNoSql.csproj
+++ b/dotnet/src/VectorData/CosmosNoSql/CosmosNoSql.csproj
@@ -25,18 +25,15 @@
-
-
-
-
-
+
-
+
+
-
-
+
+
diff --git a/dotnet/src/VectorData/Directory.Build.props b/dotnet/src/VectorData/Directory.Build.props
index 44a8810c0a8e..aa86f79b9a18 100644
--- a/dotnet/src/VectorData/Directory.Build.props
+++ b/dotnet/src/VectorData/Directory.Build.props
@@ -4,6 +4,13 @@
$(NoWarn);MEVD9000,MEVD9001
+
+
+ true
+
+
+
+
diff --git a/dotnet/src/VectorData/InMemory/InMemory.csproj b/dotnet/src/VectorData/InMemory/InMemory.csproj
index aa8cbb340f55..e463411bc6ec 100644
--- a/dotnet/src/VectorData/InMemory/InMemory.csproj
+++ b/dotnet/src/VectorData/InMemory/InMemory.csproj
@@ -37,8 +37,4 @@
-
-
-
-
diff --git a/dotnet/src/VectorData/MongoDB/MongoDB.csproj b/dotnet/src/VectorData/MongoDB/MongoDB.csproj
index fa6369f2e179..78050e3367a7 100644
--- a/dotnet/src/VectorData/MongoDB/MongoDB.csproj
+++ b/dotnet/src/VectorData/MongoDB/MongoDB.csproj
@@ -28,17 +28,10 @@
-
-
-
-
-
-
-
-
+
diff --git a/dotnet/src/VectorData/PgVector/PgVector.csproj b/dotnet/src/VectorData/PgVector/PgVector.csproj
index b171819ce395..ed07e24ce9ed 100644
--- a/dotnet/src/VectorData/PgVector/PgVector.csproj
+++ b/dotnet/src/VectorData/PgVector/PgVector.csproj
@@ -38,8 +38,8 @@
-
-
+
+
diff --git a/dotnet/src/VectorData/Pinecone/Pinecone.csproj b/dotnet/src/VectorData/Pinecone/Pinecone.csproj
index d5c5847327a2..475285b67f79 100644
--- a/dotnet/src/VectorData/Pinecone/Pinecone.csproj
+++ b/dotnet/src/VectorData/Pinecone/Pinecone.csproj
@@ -31,6 +31,7 @@
+
@@ -39,8 +40,4 @@
-
-
-
-
diff --git a/dotnet/src/VectorData/Qdrant/Qdrant.csproj b/dotnet/src/VectorData/Qdrant/Qdrant.csproj
index 86e2503a2056..8d3480310f44 100644
--- a/dotnet/src/VectorData/Qdrant/Qdrant.csproj
+++ b/dotnet/src/VectorData/Qdrant/Qdrant.csproj
@@ -25,13 +25,14 @@
+
-
+
@@ -40,8 +41,4 @@
-
-
-
-
\ No newline at end of file
diff --git a/dotnet/src/VectorData/Redis/Redis.csproj b/dotnet/src/VectorData/Redis/Redis.csproj
index 41e673ad61a5..590d8cc732d9 100644
--- a/dotnet/src/VectorData/Redis/Redis.csproj
+++ b/dotnet/src/VectorData/Redis/Redis.csproj
@@ -29,12 +29,12 @@
-
-
+
+
-
+
\ No newline at end of file
diff --git a/dotnet/src/VectorData/SqlServer/SqlServer.csproj b/dotnet/src/VectorData/SqlServer/SqlServer.csproj
index 7896ffcb03f5..b128591a19a8 100644
--- a/dotnet/src/VectorData/SqlServer/SqlServer.csproj
+++ b/dotnet/src/VectorData/SqlServer/SqlServer.csproj
@@ -33,8 +33,8 @@
-
-
+
+
diff --git a/dotnet/src/VectorData/SqliteVec/SqliteVec.csproj b/dotnet/src/VectorData/SqliteVec/SqliteVec.csproj
index ab5a3f4798dd..d9e45105e395 100644
--- a/dotnet/src/VectorData/SqliteVec/SqliteVec.csproj
+++ b/dotnet/src/VectorData/SqliteVec/SqliteVec.csproj
@@ -29,16 +29,16 @@
+
+
-
-
-
-
+
+
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/.editorconfig b/dotnet/src/VectorData/VectorData.Abstractions/.editorconfig
deleted file mode 100644
index acb2cb62caf4..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/.editorconfig
+++ /dev/null
@@ -1,3 +0,0 @@
-# Suppress missing documentation warnings for generated code (strings)
-[*.Designer.cs]
-dotnet_diagnostic.CS1591.severity = none
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/AnyTagEqualToFilterClause.cs b/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/AnyTagEqualToFilterClause.cs
deleted file mode 100644
index c9419d087732..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/AnyTagEqualToFilterClause.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using System;
-
-namespace Microsoft.Extensions.VectorData;
-
-///
-/// Represents a filter clause that filters by checking if a field consisting of a list of values contains a specific value.
-///
-[Obsolete("Use LINQ expressions via VectorSearchOptions.Filter instead. This type will be removed in a future version.")]
-public sealed class AnyTagEqualToFilterClause : FilterClause
-{
- ///
- /// Initializes a new instance of the class.
- ///
- /// The name of the field with the list of values.
- /// The value that the list should contain.
- public AnyTagEqualToFilterClause(string fieldName, string value)
- {
- this.FieldName = fieldName;
- this.Value = value;
- }
-
- ///
- /// Gets the name of the field with the list of values.
- ///
- public string FieldName { get; private set; }
-
- ///
- /// Gets the value that the list should contain.
- ///
- public string Value { get; private set; }
-}
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/EqualToFilterClause.cs b/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/EqualToFilterClause.cs
deleted file mode 100644
index 03fc678abc8b..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/EqualToFilterClause.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using System;
-
-namespace Microsoft.Extensions.VectorData;
-
-///
-/// Represents a filter clause that filters using equality of a field value.
-///
-[Obsolete("Use LINQ expressions via VectorSearchOptions.Filter instead. This type will be removed in a future version.")]
-public sealed class EqualToFilterClause : FilterClause
-{
- ///
- /// Initializes a new instance of the class.
- ///
- /// Field name.
- /// Field value.
- public EqualToFilterClause(string fieldName, object value)
- {
- this.FieldName = fieldName;
- this.Value = value;
- }
-
- ///
- /// Gets the field name to match.
- ///
- public string FieldName { get; private set; }
-
- ///
- /// Gets the field value to match.
- ///
- public object Value { get; private set; }
-}
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/FilterClause.cs b/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/FilterClause.cs
deleted file mode 100644
index 97c8869a27ea..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/FilterClause.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using System;
-
-namespace Microsoft.Extensions.VectorData;
-
-///
-/// Defines a base class for filter clauses.
-///
-///
-/// A is used to request that the underlying search service should
-/// filter search results based on the specified criteria.
-///
-[Obsolete("Use LINQ expressions via VectorSearchOptions.Filter instead. This type will be removed in a future version.")]
-public abstract class FilterClause
-{
- ///
- /// Initializes a new instance of the class.
- ///
- protected FilterClause()
- {
- }
-}
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/PACKAGE.md b/dotnet/src/VectorData/VectorData.Abstractions/PACKAGE.md
deleted file mode 100644
index 948b8527c6a8..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/PACKAGE.md
+++ /dev/null
@@ -1,51 +0,0 @@
-## About
-
-Contains abstractions for accessing Vector Databases and Vector Indexes.
-
-## Key Features
-
-- Base abstract classes and interfaces for Vector Database implementation. Vector Database implementations are provided separately in other packages, for example `Microsoft.SemanticKernel.Connectors.AzureAISearch`.
-- Abstractions include:
- - Creating, listing and deleting collections with custom schema support.
- - Creating, retrieving, updating and deleting records.
- - Similarty search using vector embeddings.
- - Search using filters.
- - Hybrid search combining vector similarity and keyword search.
- - Built-in embedding generation using `Microsoft.Extensions.AI`.
-
-## How to Use
-
-This package is typically used with an implementation of the vector database abstractions such as `Microsoft.SemanticKernel.Connectors.AzureAISearch`.
-
-## Main Types
-
-The main types provided by this library are:
-
-- [Microsoft.Extensions.VectorData.VectorStore](https://learn.microsoft.com/dotnet/api/microsoft.extensions.vectordata.vectorstore)
-- [Microsoft.Extensions.VectorData.VectorStoreCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.vectordata.vectorstorecollection-2)
-
-## Additional Documentation
-
-- [Conceptual documentation](https://learn.microsoft.com/en-us/semantic-kernel/concepts/vector-store-connectors)
-
-## Related Packages
-
-Vector Database implementations:
-
-- [Microsoft.SemanticKernel.Connectors.AzureAISearch](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.AzureAISearch)
-- [Microsoft.SemanticKernel.Connectors.CosmosMongoDB](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.CosmosMongoDB)
-- [Microsoft.SemanticKernel.Connectors.CosmosNoSQL](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.CosmosNoSQL)
-- [Elastic.SemanticKernel.Connectors.Elasticsearch](https://www.nuget.org/packages/Elastic.SemanticKernel.Connectors.Elasticsearch)
-- [Microsoft.SemanticKernel.Connectors.InMemory](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.InMemory)
-- [Microsoft.SemanticKernel.Connectors.MongoDB](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.MongoDB)
-- [Microsoft.SemanticKernel.Connectors.PgVector](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.PgVector)
-- [Microsoft.SemanticKernel.Connectors.Pinecone](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Pinecone)
-- [Microsoft.SemanticKernel.Connectors.Qdrant](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Qdrant)
-- [Microsoft.SemanticKernel.Connectors.Redis](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Redis)
-- [Microsoft.SemanticKernel.Connectors.SqliteVec](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.SqliteVec)
-- [Microsoft.SemanticKernel.Connectors.SqlServer](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.SqlServer)
-- [Microsoft.SemanticKernel.Connectors.Weaviate](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Weaviate)
-
-## Feedback & Contributing
-
-Microsoft.Extensions.VectorData.Abstractions is released as open source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/microsoft/semantic-kernel).
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/Properties/AssemblyInfo.cs b/dotnet/src/VectorData/VectorData.Abstractions/Properties/AssemblyInfo.cs
deleted file mode 100644
index 09647faa37af..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-[assembly: System.Resources.NeutralResourcesLanguage("en-US")]
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionJsonModelBuilder.cs b/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionJsonModelBuilder.cs
deleted file mode 100644
index 90a2db9433f3..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionJsonModelBuilder.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using System;
-using System.Diagnostics.CodeAnalysis;
-using System.Reflection;
-using System.Text.Json;
-using System.Text.Json.Serialization;
-using Microsoft.Extensions.AI;
-
-namespace Microsoft.Extensions.VectorData.ProviderServices;
-
-///
-/// Represents a model builder that performs logic specific to connectors that use System.Text.Json for serialization.
-/// This is an internal support type meant for use by connectors only and not by applications.
-///
-[Experimental("MEVD9001")]
-public abstract class CollectionJsonModelBuilder : CollectionModelBuilder
-{
- private JsonSerializerOptions? _jsonSerializerOptions;
-
- ///
- /// Constructs a new .
- ///
- protected CollectionJsonModelBuilder(CollectionModelBuildingOptions options)
- : base(options)
- {
- }
-
- ///
- /// Builds and returns a from the given and .
- ///
- [RequiresDynamicCode("This model building variant is not compatible with NativeAOT. See BuildDynamic() for dynamic mapping, and a third variant accepting source-generated delegates will be introduced in the future.")]
- [RequiresUnreferencedCode("This model building variant is not compatible with trimming. See BuildDynamic() for dynamic mapping, and a third variant accepting source-generated delegates will be introduced in the future.")]
- public virtual CollectionModel Build(
- Type recordType,
- Type keyType,
- VectorStoreCollectionDefinition? definition,
- IEmbeddingGenerator? defaultEmbeddingGenerator,
- JsonSerializerOptions jsonSerializerOptions)
- {
- this._jsonSerializerOptions = jsonSerializerOptions;
-
- return this.Build(recordType, keyType, definition, defaultEmbeddingGenerator);
- }
-
- ///
- /// Builds and returns a for dynamic mapping scenarios from the given .
- ///
- public virtual CollectionModel BuildDynamic(
- VectorStoreCollectionDefinition definition,
- IEmbeddingGenerator? defaultEmbeddingGenerator,
- JsonSerializerOptions jsonSerializerOptions)
- {
- this._jsonSerializerOptions = jsonSerializerOptions;
-
- return this.BuildDynamic(definition, defaultEmbeddingGenerator);
- }
-
- ///
- protected override void Customize()
- {
- // This mimics the naming behavior of the System.Text.Json serializer, which we use for serialization/deserialization.
- // The property storage names in the model must in sync with the serializer configuration, since the model is used e.g. for filtering
- // even if serialization/deserialization doesn't use the model.
- var namingPolicy = this._jsonSerializerOptions?.PropertyNamingPolicy;
-
- foreach (var property in this.Properties)
- {
- var keyPropertyWithReservedName = this.Options.ReservedKeyStorageName is not null && property is KeyPropertyModel;
- string storageName;
-
- if (property.PropertyInfo?.GetCustomAttribute() is { } jsonPropertyNameAttribute)
- {
- if (keyPropertyWithReservedName && jsonPropertyNameAttribute.Name != this.Options.ReservedKeyStorageName)
- {
- throw new InvalidOperationException($"The key property for your connector must always have the reserved name '{this.Options.ReservedKeyStorageName}' and cannot be changed.");
- }
-
- storageName = jsonPropertyNameAttribute.Name;
- }
- else if (namingPolicy is not null)
- {
- storageName = namingPolicy.ConvertName(property.ModelName);
- }
- else
- {
- storageName = property.ModelName;
- }
-
- if (keyPropertyWithReservedName)
- {
- // Some providers (Weaviate, Cosmos NoSQL) have a fixed, reserved storage name for keys (id), and at the same time use an external
- // JSON serializer to serialize the entire user POCO. Since the serializer is unaware of the reserved storage name, it will produce
- // a storage name as usual, based on the .NET property's name, possibly with a naming policy applied to it. The connector then needs
- // to look that up and replace with the reserved name.
- ((KeyPropertyModel)property).SerializedKeyName = storageName;
- }
- else
- {
- property.StorageName = storageName;
- }
- }
- }
-}
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModel.cs b/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModel.cs
deleted file mode 100644
index 7f837038dfa6..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModel.cs
+++ /dev/null
@@ -1,243 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-namespace Microsoft.Extensions.VectorData.ProviderServices;
-
-///
-/// Represents a record in a vector store collection.
-/// This is an internal support type meant for use by connectors only and not by applications.
-///
-[Experimental("MEVD9001")]
-public sealed class CollectionModel
-{
- private readonly Type _recordType;
- private readonly Func
+
-
+
-
-
-
-
diff --git a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/AzureAISearch.ConformanceTests.csproj b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/AzureAISearch.ConformanceTests.csproj
index 7f642f209a84..a9ced5e1c21a 100644
--- a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/AzureAISearch.ConformanceTests.csproj
+++ b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/AzureAISearch.ConformanceTests.csproj
@@ -28,7 +28,6 @@
-
diff --git a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/AzureAISearchAllSupportedTypesTests.cs b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/AzureAISearchAllSupportedTypesTests.cs
index a69879faa3c5..da487571a509 100644
--- a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/AzureAISearchAllSupportedTypesTests.cs
+++ b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/AzureAISearchAllSupportedTypesTests.cs
@@ -2,14 +2,13 @@
using AzureAISearch.ConformanceTests.Support;
using Microsoft.Extensions.VectorData;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace AzureAISearch.ConformanceTests;
public class AzureAISearchAllSupportedTypesTests(AzureAISearchFixture fixture) : IClassFixture
{
- [ConditionalFact]
+ [Fact]
public async Task AllTypesBatchGetAsync()
{
var collection = fixture.TestStore.DefaultVectorStore.GetCollection("all-types", AzureAISearchAllTypes.GetRecordDefinition());
diff --git a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/AzureAISearchIndexKindTests.cs b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/AzureAISearchIndexKindTests.cs
index 844e905999f3..57c9e13650a4 100644
--- a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/AzureAISearchIndexKindTests.cs
+++ b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/AzureAISearchIndexKindTests.cs
@@ -4,7 +4,6 @@
using Microsoft.Extensions.VectorData;
using VectorData.ConformanceTests;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace AzureAISearch.ConformanceTests;
@@ -12,7 +11,7 @@ namespace AzureAISearch.ConformanceTests;
public class AzureAISearchIndexKindTests(AzureAISearchIndexKindTests.Fixture fixture)
: IndexKindTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task Hnsw()
=> this.Test(IndexKind.Hnsw);
diff --git a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Properties/AssemblyAttributes.cs b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Properties/AssemblyAttributes.cs
index 7458ef02a07b..cbb67c1c8afd 100644
--- a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Properties/AssemblyAttributes.cs
+++ b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Properties/AssemblyAttributes.cs
@@ -1,3 +1 @@
// Copyright (c) Microsoft. All rights reserved.
-
-[assembly: AzureAISearch.ConformanceTests.Support.AzureAISearchUrlRequiredAttribute]
diff --git a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Support/AzureAISearchAllTypes.cs b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Support/AzureAISearchAllTypes.cs
index 1c099bc7f4d1..26437a5e5c9e 100644
--- a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Support/AzureAISearchAllTypes.cs
+++ b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Support/AzureAISearchAllTypes.cs
@@ -70,7 +70,7 @@ public class AzureAISearchAllTypes
[VectorStoreData]
public List DateTimeOffsetList { get; set; }
- [VectorStoreVector(Dimensions: 8, DistanceFunction = DistanceFunction.DotProductSimilarity)]
+ [VectorStoreVector(dimensions: 8, DistanceFunction = DistanceFunction.DotProductSimilarity)]
public ReadOnlyMemory? Embedding { get; set; }
internal void AssertEqual(AzureAISearchAllTypes other)
diff --git a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Support/AzureAISearchTestEnvironment.cs b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Support/AzureAISearchTestEnvironment.cs
index dc63ea196fae..600136e9b1c5 100644
--- a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Support/AzureAISearchTestEnvironment.cs
+++ b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Support/AzureAISearchTestEnvironment.cs
@@ -23,7 +23,7 @@ static AzureAISearchTestEnvironment()
.AddJsonFile(path: "testsettings.json", optional: true)
.AddJsonFile(path: "testsettings.development.json", optional: true)
.AddEnvironmentVariables()
- .AddUserSecrets()
+ .AddUserSecrets()
.Build();
var azureAISearchSection = configuration.GetSection("AzureAISearch");
diff --git a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Support/AzureAISearchUrlRequiredAttribute.cs b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Support/AzureAISearchUrlRequiredAttribute.cs
deleted file mode 100644
index c04c71595c5a..000000000000
--- a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/Support/AzureAISearchUrlRequiredAttribute.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using VectorData.ConformanceTests.Xunit;
-
-namespace AzureAISearch.ConformanceTests.Support;
-
-///
-/// Checks whether the sqlite_vec extension is properly installed, and skips the test(s) otherwise.
-///
-[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)]
-public sealed class AzureAISearchUrlRequiredAttribute : Attribute, ITestCondition
-{
- public ValueTask IsMetAsync() => new(AzureAISearchTestEnvironment.IsConnectionInfoDefined);
-
- public string Skip { get; set; } = "Service URL is not configured, set AzureAISearch:ServiceUrl (and AzureAISearch:ApiKey if you don't use managed identity).";
-
- public string SkipReason
- => this.Skip;
-}
diff --git a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/TypeTests/AzureAISearchDataTypeTests.cs b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/TypeTests/AzureAISearchDataTypeTests.cs
index 535f51632b29..b0d577ef481f 100644
--- a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/TypeTests/AzureAISearchDataTypeTests.cs
+++ b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/TypeTests/AzureAISearchDataTypeTests.cs
@@ -4,7 +4,6 @@
using Microsoft.Extensions.VectorData;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace AzureAISearch.ConformanceTests.TypeTests;
@@ -13,7 +12,7 @@ public class AzureAISearchDataTypeTests(AzureAISearchDataTypeTests.Fixture fixtu
: DataTypeTests(fixture),
IClassFixture
{
- [ConditionalFact(Skip = "Issues around empty collection initialization")]
+ [Fact(Skip = "Issues around empty collection initialization")]
public override Task String_array() => Task.CompletedTask;
protected override object? GenerateEmptyProperty(VectorStoreProperty property)
diff --git a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/TypeTests/AzureAISearchKeyTypeTests.cs b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/TypeTests/AzureAISearchKeyTypeTests.cs
index 2a9266654964..378bbf67e45b 100644
--- a/dotnet/test/VectorData/AzureAISearch.ConformanceTests/TypeTests/AzureAISearchKeyTypeTests.cs
+++ b/dotnet/test/VectorData/AzureAISearch.ConformanceTests/TypeTests/AzureAISearchKeyTypeTests.cs
@@ -3,7 +3,6 @@
using AzureAISearch.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace AzureAISearch.ConformanceTests.TypeTests;
@@ -11,7 +10,7 @@ namespace AzureAISearch.ConformanceTests.TypeTests;
public class AzureAISearchKeyTypeTests(AzureAISearchKeyTypeTests.Fixture fixture)
: KeyTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task String() => this.Test("foo", "bar");
public new class Fixture : KeyTypeTests.Fixture
diff --git a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoBsonMappingTests.cs b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoBsonMappingTests.cs
index 44b99c00d98d..549eb724ad46 100644
--- a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoBsonMappingTests.cs
+++ b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoBsonMappingTests.cs
@@ -5,16 +5,14 @@
using Microsoft.SemanticKernel.Connectors.CosmosMongoDB;
using MongoDB.Bson.Serialization.Attributes;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace CosmosMongoDB.ConformanceTests;
-[CosmosConnectionStringRequired]
public sealed class CosmosMongoBsonMappingTests(CosmosMongoBsonMappingTests.Fixture fixture)
: IClassFixture
{
- [ConditionalFact]
+ [Fact]
public async Task Upsert_with_bson_model_works()
{
var store = (CosmosMongoTestStore)fixture.TestStore;
@@ -53,7 +51,7 @@ public async Task Upsert_with_bson_model_works()
}
}
- [ConditionalFact]
+ [Fact]
public async Task Upsert_with_bson_vector_store_model_works()
{
var store = (CosmosMongoTestStore)fixture.TestStore;
@@ -80,7 +78,7 @@ public async Task Upsert_with_bson_vector_store_model_works()
}
}
- [ConditionalFact]
+ [Fact]
public async Task Upsert_with_bson_vector_store_with_name_model_works()
{
var store = (CosmosMongoTestStore)fixture.TestStore;
diff --git a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoDB.ConformanceTests.csproj b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoDB.ConformanceTests.csproj
index 8c0a1d9b37b7..a302e8425ec1 100644
--- a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoDB.ConformanceTests.csproj
+++ b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoDB.ConformanceTests.csproj
@@ -25,7 +25,6 @@
-
diff --git a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoFilterTests.cs b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoFilterTests.cs
index a644f1f1b00d..1b857a4d3383 100644
--- a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoFilterTests.cs
+++ b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoFilterTests.cs
@@ -3,7 +3,6 @@
using CosmosMongoDB.ConformanceTests.Support;
using VectorData.ConformanceTests;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace CosmosMongoDB.ConformanceTests;
@@ -12,7 +11,7 @@ public class CosmosMongoFilterTests(CosmosMongoFilterTests.Fixture fixture)
: FilterTests(fixture), IClassFixture
{
// Specialized MongoDB syntax for NOT over Contains ($nin)
- [ConditionalFact]
+ [Fact]
public virtual Task Not_over_Contains()
=> this.TestFilterAsync(
r => !new[] { 8, 10 }.Contains(r.Int),
diff --git a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoIndexKindTests.cs b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoIndexKindTests.cs
index af6c091c4dab..77fcccfcaa72 100644
--- a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoIndexKindTests.cs
+++ b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoIndexKindTests.cs
@@ -4,7 +4,6 @@
using Microsoft.Extensions.VectorData;
using VectorData.ConformanceTests;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace CosmosMongoDB.ConformanceTests;
@@ -13,11 +12,11 @@ public class CosmosMongoIndexKindTests(CosmosMongoIndexKindTests.Fixture fixture
: IndexKindTests(fixture), IClassFixture
{
// Note: Cosmos Mongo support HNSW, but only in a specific tier.
- // [ConditionalFact]
+ // [Fact]
// public virtual Task Hnsw()
// => this.Test(IndexKind.Hnsw);
- [ConditionalFact]
+ [Fact]
public virtual Task IvfFlat()
=> this.Test(IndexKind.IvfFlat);
diff --git a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/Properties/AssemblyAttributes.cs b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/Properties/AssemblyAttributes.cs
index 4889cb87e6b6..cbb67c1c8afd 100644
--- a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/Properties/AssemblyAttributes.cs
+++ b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/Properties/AssemblyAttributes.cs
@@ -1,3 +1 @@
// Copyright (c) Microsoft. All rights reserved.
-
-[assembly: CosmosMongoDB.ConformanceTests.Support.CosmosConnectionStringRequired]
diff --git a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/Support/CosmosConnectionStringRequiredAttribute.cs b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/Support/CosmosConnectionStringRequiredAttribute.cs
deleted file mode 100644
index 5eae7f790892..000000000000
--- a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/Support/CosmosConnectionStringRequiredAttribute.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using VectorData.ConformanceTests.Xunit;
-
-namespace CosmosMongoDB.ConformanceTests.Support;
-
-///
-/// Checks whether the sqlite_vec extension is properly installed, and skips the test(s) otherwise.
-///
-[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)]
-public sealed class CosmosConnectionStringRequiredAttribute : Attribute, ITestCondition
-{
- public ValueTask IsMetAsync() => new(CosmosMongoTestEnvironment.IsConnectionStringDefined);
-
- public string Skip { get; set; } = "The Cosmos connection string hasn't been configured (CosmosMongo:ConnectionString).";
-
- public string SkipReason
- => this.Skip;
-}
diff --git a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/Support/CosmosMongoTestEnvironment.cs b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/Support/CosmosMongoTestEnvironment.cs
index e86d0d13b3b3..7c6581121cee 100644
--- a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/Support/CosmosMongoTestEnvironment.cs
+++ b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/Support/CosmosMongoTestEnvironment.cs
@@ -18,7 +18,7 @@ static CosmosMongoTestEnvironment()
.AddJsonFile(path: "testsettings.json", optional: true)
.AddJsonFile(path: "testsettings.development.json", optional: true)
.AddEnvironmentVariables()
- .AddUserSecrets()
+ .AddUserSecrets()
.Build();
ConnectionString = configuration["CosmosMongo:ConnectionString"];
diff --git a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/TypeTests/CosmosMongoKeyTypeTests.cs b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/TypeTests/CosmosMongoKeyTypeTests.cs
index 62533ade31e3..ebfe0ff8a0f9 100644
--- a/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/TypeTests/CosmosMongoKeyTypeTests.cs
+++ b/dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/TypeTests/CosmosMongoKeyTypeTests.cs
@@ -4,7 +4,6 @@
using MongoDB.Bson;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace CosmosMongoDB.ConformanceTests.TypeTests;
@@ -12,16 +11,16 @@ namespace CosmosMongoDB.ConformanceTests.TypeTests;
public class CosmosMongoKeyTypeTests(CosmosMongoKeyTypeTests.Fixture fixture)
: KeyTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task ObjectId() => this.Test(new("652f8c3e8f9b2c1a4d3e6a7b"), supportsAutoGeneration: true);
- [ConditionalFact]
+ [Fact]
public virtual Task String() => this.Test("foo", "bar");
- [ConditionalFact]
+ [Fact]
public virtual Task Int() => this.Test(8);
- [ConditionalFact]
+ [Fact]
public virtual Task Long() => this.Test(8L);
public new class Fixture : KeyTypeTests.Fixture
diff --git a/dotnet/test/VectorData/CosmosMongoDB.UnitTests/CosmosMongoCollectionTests.cs b/dotnet/test/VectorData/CosmosMongoDB.UnitTests/CosmosMongoCollectionTests.cs
index cdb1dc794918..793075e47cc0 100644
--- a/dotnet/test/VectorData/CosmosMongoDB.UnitTests/CosmosMongoCollectionTests.cs
+++ b/dotnet/test/VectorData/CosmosMongoDB.UnitTests/CosmosMongoCollectionTests.cs
@@ -700,11 +700,11 @@ private sealed class VectorSearchModel
[VectorStoreData]
public string? HotelName { get; set; }
- [VectorStoreVector(Dimensions: 4, DistanceFunction = DistanceFunction.CosineDistance, IndexKind = IndexKind.IvfFlat, StorageName = "test_embedding_1")]
+ [VectorStoreVector(dimensions: 4, DistanceFunction = DistanceFunction.CosineDistance, IndexKind = IndexKind.IvfFlat, StorageName = "test_embedding_1")]
public ReadOnlyMemory TestEmbedding1 { get; set; }
[BsonElement("test_embedding_2")]
- [VectorStoreVector(Dimensions: 4, DistanceFunction = DistanceFunction.CosineDistance, IndexKind = IndexKind.IvfFlat)]
+ [VectorStoreVector(dimensions: 4, DistanceFunction = DistanceFunction.CosineDistance, IndexKind = IndexKind.IvfFlat)]
public ReadOnlyMemory TestEmbedding2 { get; set; }
}
#pragma warning restore CA1812
diff --git a/dotnet/test/VectorData/CosmosMongoDB.UnitTests/CosmosMongoHotelModel.cs b/dotnet/test/VectorData/CosmosMongoDB.UnitTests/CosmosMongoHotelModel.cs
index ec83f23ad9f1..fc434d094989 100644
--- a/dotnet/test/VectorData/CosmosMongoDB.UnitTests/CosmosMongoHotelModel.cs
+++ b/dotnet/test/VectorData/CosmosMongoDB.UnitTests/CosmosMongoHotelModel.cs
@@ -39,6 +39,6 @@ public class CosmosMongoHotelModel(string hotelId)
public string? Description { get; set; }
/// A vector field.
- [VectorStoreVector(Dimensions: 4, DistanceFunction = DistanceFunction.CosineDistance, IndexKind = IndexKind.IvfFlat)]
+ [VectorStoreVector(dimensions: 4, DistanceFunction = DistanceFunction.CosineDistance, IndexKind = IndexKind.IvfFlat)]
public ReadOnlyMemory? DescriptionEmbedding { get; set; }
}
diff --git a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/CosmosNoSql.ConformanceTests.csproj b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/CosmosNoSql.ConformanceTests.csproj
index 838c0f16e0f8..d8b012a849d2 100644
--- a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/CosmosNoSql.ConformanceTests.csproj
+++ b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/CosmosNoSql.ConformanceTests.csproj
@@ -25,7 +25,6 @@
-
diff --git a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/CosmosNoSqlCollectionOptionsTests.cs b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/CosmosNoSqlCollectionOptionsTests.cs
index b7fae39008be..fbbe3b8f696c 100644
--- a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/CosmosNoSqlCollectionOptionsTests.cs
+++ b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/CosmosNoSqlCollectionOptionsTests.cs
@@ -5,16 +5,14 @@
using Microsoft.Extensions.VectorData;
using Microsoft.SemanticKernel.Connectors.CosmosNoSql;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace CosmosNoSql.ConformanceTests;
-[CosmosConnectionStringRequired]
public sealed class CosmosNoSqlCollectionOptionsTests(CosmosNoSqlCollectionOptionsTests.Fixture fixture)
: IClassFixture
{
- [ConditionalFact]
+ [Fact]
public async Task Collection_supports_partition_key_composite_key()
{
var store = (CosmosNoSqlTestStore)fixture.TestStore;
@@ -53,7 +51,7 @@ public async Task Collection_supports_partition_key_composite_key()
}
}
- [ConditionalTheory]
+ [Theory]
[InlineData(IndexingMode.Consistent)]
[InlineData(IndexingMode.Lazy)]
[InlineData(IndexingMode.None)]
@@ -108,7 +106,7 @@ private sealed class PartitionedHotel
[VectorStoreData]
public string? Description { get; set; }
- [VectorStoreVector(Dimensions: 3)]
+ [VectorStoreVector(dimensions: 3)]
public ReadOnlyMemory Embedding { get; set; }
}
@@ -120,7 +118,7 @@ private sealed class IndexingModeHotel
[VectorStoreData]
public string HotelName { get; set; } = string.Empty;
- [VectorStoreVector(Dimensions: 3)]
+ [VectorStoreVector(dimensions: 3)]
public ReadOnlyMemory Embedding { get; set; }
}
}
diff --git a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/CosmosNoSqlIndexKindTests.cs b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/CosmosNoSqlIndexKindTests.cs
index e95cc67d1d54..b6ee0432fc3e 100644
--- a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/CosmosNoSqlIndexKindTests.cs
+++ b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/CosmosNoSqlIndexKindTests.cs
@@ -4,7 +4,6 @@
using Microsoft.Extensions.VectorData;
using VectorData.ConformanceTests;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace CosmosNoSql.ConformanceTests;
@@ -12,7 +11,7 @@ namespace CosmosNoSql.ConformanceTests;
public class CosmosNoSqlIndexKindTests(CosmosNoSqlIndexKindTests.Fixture fixture)
: IndexKindTests(fixture), IClassFixture
{
- [ConditionalFact(Skip = "DiskANN is supported by Cosmos NoSQL, but is not supported on the emulator and needs to be explicitly enabled")]
+ [Fact(Skip = "DiskANN is supported by Cosmos NoSQL, but is not supported on the emulator and needs to be explicitly enabled")]
public virtual Task DiskANN()
=> this.Test(IndexKind.DiskAnn);
diff --git a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/Properties/AssemblyAttributes.cs b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/Properties/AssemblyAttributes.cs
index 55e7e46eb05b..cbb67c1c8afd 100644
--- a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/Properties/AssemblyAttributes.cs
+++ b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/Properties/AssemblyAttributes.cs
@@ -1,3 +1 @@
// Copyright (c) Microsoft. All rights reserved.
-
-[assembly: CosmosNoSql.ConformanceTests.Support.CosmosConnectionStringRequired]
diff --git a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/Support/CosmosConnectionStringRequiredAttribute.cs b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/Support/CosmosConnectionStringRequiredAttribute.cs
deleted file mode 100644
index cb84c96d4ea7..000000000000
--- a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/Support/CosmosConnectionStringRequiredAttribute.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using VectorData.ConformanceTests.Xunit;
-
-namespace CosmosNoSql.ConformanceTests.Support;
-
-///
-/// Checks whether the sqlite_vec extension is properly installed, and skips the test(s) otherwise.
-///
-[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)]
-public sealed class CosmosConnectionStringRequiredAttribute : Attribute, ITestCondition
-{
- public ValueTask IsMetAsync() => new(CosmosNoSqlTestEnvironment.IsConnectionStringDefined);
-
- public string Skip { get; set; } = "The Cosmos connection string hasn't been configured (CosmosNoSql:ConnectionString).";
-
- public string SkipReason
- => this.Skip;
-}
diff --git a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/Support/CosmosNoSqlTestEnvironment.cs b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/Support/CosmosNoSqlTestEnvironment.cs
index 4b50c98a64a3..ebb9b6357712 100644
--- a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/Support/CosmosNoSqlTestEnvironment.cs
+++ b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/Support/CosmosNoSqlTestEnvironment.cs
@@ -18,7 +18,7 @@ static CosmosNoSqlTestEnvironment()
.AddJsonFile(path: "testsettings.json", optional: true)
.AddJsonFile(path: "testsettings.development.json", optional: true)
.AddEnvironmentVariables()
- .AddUserSecrets()
+ .AddUserSecrets()
.Build();
ConnectionString = configuration["CosmosNoSql:ConnectionString"];
diff --git a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/TypeTests/CosmosNoSqlDataTypeTests.cs b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/TypeTests/CosmosNoSqlDataTypeTests.cs
index cfd228cdac17..f41f9465a1a8 100644
--- a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/TypeTests/CosmosNoSqlDataTypeTests.cs
+++ b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/TypeTests/CosmosNoSqlDataTypeTests.cs
@@ -3,7 +3,6 @@
using CosmosNoSql.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace CosmosNoSql.ConformanceTests.TypeTests;
@@ -13,7 +12,7 @@ public class CosmosNoSqlDataTypeTests(CosmosNoSqlDataTypeTests.Fixture fixture)
{
// Cosmos doesn't support DateTimeOffset with non-zero offset, so we convert it to UTC.
// See https://github.com/dotnet/efcore/issues/35310
- [ConditionalFact(Skip = "Need to convert DateTimeOffset to UTC before sending to Cosmos")]
+ [Fact(Skip = "Need to convert DateTimeOffset to UTC before sending to Cosmos")]
public override Task DateTimeOffset()
=> this.Test(
"DateTimeOffset",
diff --git a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/TypeTests/CosmosNoSqlEmbeddingTypeTests.cs b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/TypeTests/CosmosNoSqlEmbeddingTypeTests.cs
index 1bb0e73d20fa..4e80e9b76dc9 100644
--- a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/TypeTests/CosmosNoSqlEmbeddingTypeTests.cs
+++ b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/TypeTests/CosmosNoSqlEmbeddingTypeTests.cs
@@ -4,7 +4,6 @@
using Microsoft.Extensions.AI;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
#pragma warning disable CA2000 // Dispose objects before losing scope
@@ -14,41 +13,41 @@ namespace CosmosNoSql.ConformanceTests.TypeTests;
public class CosmosNoSqlEmbeddingTypeTests(CosmosNoSqlEmbeddingTypeTests.Fixture fixture)
: EmbeddingTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task ReadOnlyMemory_of_byte()
=> this.Test>(
new ReadOnlyMemory([1, 2, 3]),
new ReadOnlyMemoryEmbeddingGenerator([1, 2, 3]),
vectorEqualityAsserter: (e, a) => Assert.Equal(e.Span.ToArray(), a.Span.ToArray()));
- [ConditionalFact]
+ [Fact]
public virtual Task Embedding_of_byte()
=> this.Test>(
new Embedding(new ReadOnlyMemory([1, 2, 3])),
new ReadOnlyMemoryEmbeddingGenerator([1, 2, 3]),
vectorEqualityAsserter: (e, a) => Assert.Equal(e.Vector.Span.ToArray(), a.Vector.Span.ToArray()));
- [ConditionalFact]
+ [Fact]
public virtual Task Array_of_byte()
=> this.Test(
[1, 2, 3],
new ReadOnlyMemoryEmbeddingGenerator([1, 2, 3]));
- [ConditionalFact]
+ [Fact]
public virtual Task ReadOnlyMemory_of_sbyte()
=> this.Test>(
new ReadOnlyMemory([1, 2, 3]),
new ReadOnlyMemoryEmbeddingGenerator([1, 2, 3]),
vectorEqualityAsserter: (e, a) => Assert.Equal(e.Span.ToArray(), a.Span.ToArray()));
- [ConditionalFact]
+ [Fact]
public virtual Task Embedding_of_sbyte()
=> this.Test>(
new Embedding(new ReadOnlyMemory([1, 2, 3])),
new ReadOnlyMemoryEmbeddingGenerator([1, 2, 3]),
vectorEqualityAsserter: (e, a) => Assert.Equal(e.Vector.Span.ToArray(), a.Vector.Span.ToArray()));
- [ConditionalFact]
+ [Fact]
public virtual Task Array_of_sbyte()
=> this.Test(
[1, 2, 3],
diff --git a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/TypeTests/CosmosNoSqlKeyTypeTests.cs b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/TypeTests/CosmosNoSqlKeyTypeTests.cs
index 0e64d33e9e3b..f70db5a30787 100644
--- a/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/TypeTests/CosmosNoSqlKeyTypeTests.cs
+++ b/dotnet/test/VectorData/CosmosNoSql.ConformanceTests/TypeTests/CosmosNoSqlKeyTypeTests.cs
@@ -3,7 +3,6 @@
using CosmosNoSql.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace CosmosNoSql.ConformanceTests.TypeTests;
@@ -11,7 +10,7 @@ namespace CosmosNoSql.ConformanceTests.TypeTests;
public class CosmosNoSqlKeyTypeTests(CosmosNoSqlKeyTypeTests.Fixture fixture)
: KeyTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task String() => this.Test("foo", "bar");
public new class Fixture : KeyTypeTests.Fixture
diff --git a/dotnet/test/VectorData/CosmosNoSql.UnitTests/CosmosNoSqlCollectionTests.cs b/dotnet/test/VectorData/CosmosNoSql.UnitTests/CosmosNoSqlCollectionTests.cs
index 7efb13bab864..ce7e8867d5bc 100644
--- a/dotnet/test/VectorData/CosmosNoSql.UnitTests/CosmosNoSqlCollectionTests.cs
+++ b/dotnet/test/VectorData/CosmosNoSql.UnitTests/CosmosNoSqlCollectionTests.cs
@@ -632,13 +632,13 @@ private sealed class TestIndexingModel
[VectorStoreKey]
public string? Id { get; set; }
- [VectorStoreVector(Dimensions: 2, DistanceFunction = DistanceFunction.CosineSimilarity, IndexKind = IndexKind.Flat)]
+ [VectorStoreVector(dimensions: 2, DistanceFunction = DistanceFunction.CosineSimilarity, IndexKind = IndexKind.Flat)]
public ReadOnlyMemory? DescriptionEmbedding2 { get; set; }
- [VectorStoreVector(Dimensions: 3, DistanceFunction = DistanceFunction.DotProductSimilarity, IndexKind = IndexKind.QuantizedFlat)]
+ [VectorStoreVector(dimensions: 3, DistanceFunction = DistanceFunction.DotProductSimilarity, IndexKind = IndexKind.QuantizedFlat)]
public ReadOnlyMemory? DescriptionEmbedding3 { get; set; }
- [VectorStoreVector(Dimensions: 4, DistanceFunction = DistanceFunction.EuclideanDistance, IndexKind = IndexKind.DiskAnn)]
+ [VectorStoreVector(dimensions: 4, DistanceFunction = DistanceFunction.EuclideanDistance, IndexKind = IndexKind.DiskAnn)]
public ReadOnlyMemory? DescriptionEmbedding4 { get; set; }
[VectorStoreData(IsIndexed = true)]
diff --git a/dotnet/test/VectorData/CosmosNoSql.UnitTests/CosmosNoSqlHotel.cs b/dotnet/test/VectorData/CosmosNoSql.UnitTests/CosmosNoSqlHotel.cs
index 9967675b5214..7913a0baa5db 100644
--- a/dotnet/test/VectorData/CosmosNoSql.UnitTests/CosmosNoSqlHotel.cs
+++ b/dotnet/test/VectorData/CosmosNoSql.UnitTests/CosmosNoSqlHotel.cs
@@ -39,6 +39,6 @@ public class CosmosNoSqlHotel(string hotelId)
/// A vector field.
[JsonPropertyName("description_embedding")]
- [VectorStoreVector(Dimensions: 4, DistanceFunction = DistanceFunction.CosineSimilarity, IndexKind = IndexKind.Flat)]
+ [VectorStoreVector(dimensions: 4, DistanceFunction = DistanceFunction.CosineSimilarity, IndexKind = IndexKind.Flat)]
public ReadOnlyMemory? DescriptionEmbedding { get; set; }
}
diff --git a/dotnet/test/VectorData/Directory.Build.props b/dotnet/test/VectorData/Directory.Build.props
index 8c60dd1d8b50..4154d5929a88 100644
--- a/dotnet/test/VectorData/Directory.Build.props
+++ b/dotnet/test/VectorData/Directory.Build.props
@@ -19,6 +19,13 @@
$(NoWarn);IDE0340
+
+
+ true
+
+
+
+
diff --git a/dotnet/test/VectorData/InMemory.ConformanceTests/InMemory.ConformanceTests.csproj b/dotnet/test/VectorData/InMemory.ConformanceTests/InMemory.ConformanceTests.csproj
index 7c7e170881b2..678d14ed5bf1 100644
--- a/dotnet/test/VectorData/InMemory.ConformanceTests/InMemory.ConformanceTests.csproj
+++ b/dotnet/test/VectorData/InMemory.ConformanceTests/InMemory.ConformanceTests.csproj
@@ -21,7 +21,6 @@
-
diff --git a/dotnet/test/VectorData/InMemory.ConformanceTests/TypeTests/InMemoryKeyTypeTests.cs b/dotnet/test/VectorData/InMemory.ConformanceTests/TypeTests/InMemoryKeyTypeTests.cs
index d0d8f4e3bf8c..1de57166871d 100644
--- a/dotnet/test/VectorData/InMemory.ConformanceTests/TypeTests/InMemoryKeyTypeTests.cs
+++ b/dotnet/test/VectorData/InMemory.ConformanceTests/TypeTests/InMemoryKeyTypeTests.cs
@@ -3,7 +3,6 @@
using InMemory.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace InMemory.ConformanceTests.TypeTests;
@@ -13,13 +12,13 @@ public class InMemoryKeyTypeTests(InMemoryKeyTypeTests.Fixture fixture)
{
// The InMemory provider supports all .NET types as keys; below are just a few basic tests.
- [ConditionalFact]
+ [Fact]
public virtual Task Int() => this.Test(8, 9);
- [ConditionalFact]
+ [Fact]
public virtual Task Long() => this.Test(8L, 9L);
- [ConditionalFact]
+ [Fact]
public virtual Task String() => this.Test("foo", "bar");
protected override async Task Test(TKey key1, TKey key2, bool supportsAutoGeneration = false)
diff --git a/dotnet/test/VectorData/MongoDB.ConformanceTests/MongoBsonMappingTests.cs b/dotnet/test/VectorData/MongoDB.ConformanceTests/MongoBsonMappingTests.cs
index f17caa806825..a09202fd79e3 100644
--- a/dotnet/test/VectorData/MongoDB.ConformanceTests/MongoBsonMappingTests.cs
+++ b/dotnet/test/VectorData/MongoDB.ConformanceTests/MongoBsonMappingTests.cs
@@ -5,7 +5,6 @@
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace MongoDB.ConformanceTests;
@@ -13,7 +12,7 @@ namespace MongoDB.ConformanceTests;
public sealed class MongoBsonMappingTests(MongoBsonMappingTests.Fixture fixture)
: IClassFixture
{
- [ConditionalFact]
+ [Fact]
public async Task Upsert_with_bson_model_works()
{
var store = (MongoTestStore)fixture.TestStore;
@@ -52,7 +51,7 @@ public async Task Upsert_with_bson_model_works()
}
}
- [ConditionalFact]
+ [Fact]
public async Task Upsert_with_bson_vector_store_model_works()
{
var store = (MongoTestStore)fixture.TestStore;
@@ -79,7 +78,7 @@ public async Task Upsert_with_bson_vector_store_model_works()
}
}
- [ConditionalFact]
+ [Fact]
public async Task Upsert_with_bson_vector_store_with_name_model_works()
{
var store = (MongoTestStore)fixture.TestStore;
diff --git a/dotnet/test/VectorData/MongoDB.ConformanceTests/MongoDB.ConformanceTests.csproj b/dotnet/test/VectorData/MongoDB.ConformanceTests/MongoDB.ConformanceTests.csproj
index f6aa797d164e..b42c59f8a352 100644
--- a/dotnet/test/VectorData/MongoDB.ConformanceTests/MongoDB.ConformanceTests.csproj
+++ b/dotnet/test/VectorData/MongoDB.ConformanceTests/MongoDB.ConformanceTests.csproj
@@ -24,7 +24,6 @@
-
diff --git a/dotnet/test/VectorData/MongoDB.ConformanceTests/MongoFilterTests.cs b/dotnet/test/VectorData/MongoDB.ConformanceTests/MongoFilterTests.cs
index d1541b604db6..7dff736a2fba 100644
--- a/dotnet/test/VectorData/MongoDB.ConformanceTests/MongoFilterTests.cs
+++ b/dotnet/test/VectorData/MongoDB.ConformanceTests/MongoFilterTests.cs
@@ -3,7 +3,6 @@
using MongoDB.ConformanceTests.Support;
using VectorData.ConformanceTests;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace MongoDB.ConformanceTests;
@@ -12,7 +11,7 @@ public class MongoFilterTests(MongoFilterTests.Fixture fixture)
: FilterTests(fixture), IClassFixture
{
// Specialized MongoDB syntax for NOT over Contains ($nin)
- [ConditionalFact]
+ [Fact]
public virtual Task Not_over_Contains()
=> this.TestFilterAsync(
r => !new[] { 8, 10 }.Contains(r.Int),
@@ -65,7 +64,7 @@ public override Task Contains_with_MemoryExtensions_Contains()
#endif
#if NET10_0_OR_GREATER
- [ConditionalFact]
+ [Fact]
public override Task Contains_with_MemoryExtensions_Contains_with_null_comparer()
=> Assert.ThrowsAsync(base.Contains_with_MemoryExtensions_Contains_with_null_comparer);
#endif
diff --git a/dotnet/test/VectorData/MongoDB.ConformanceTests/Properties/AssemblyInfo.cs b/dotnet/test/VectorData/MongoDB.ConformanceTests/Properties/AssemblyInfo.cs
deleted file mode 100644
index 2e8748461853..000000000000
--- a/dotnet/test/VectorData/MongoDB.ConformanceTests/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using VectorData.ConformanceTests.Xunit;
-
-[assembly: DisableTests(Skip = "The MongoDB container is intermittently timing out at startup time blocking prs, so these test should be run manually.")]
diff --git a/dotnet/test/VectorData/MongoDB.ConformanceTests/TypeTests/MongoKeyTypeTests.cs b/dotnet/test/VectorData/MongoDB.ConformanceTests/TypeTests/MongoKeyTypeTests.cs
index 89989a9e128c..09299942fcec 100644
--- a/dotnet/test/VectorData/MongoDB.ConformanceTests/TypeTests/MongoKeyTypeTests.cs
+++ b/dotnet/test/VectorData/MongoDB.ConformanceTests/TypeTests/MongoKeyTypeTests.cs
@@ -4,7 +4,6 @@
using MongoDB.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace MongoDB.ConformanceTests.TypeTests;
@@ -12,16 +11,16 @@ namespace MongoDB.ConformanceTests.TypeTests;
public class MongoKeyTypeTests(MongoKeyTypeTests.Fixture fixture)
: KeyTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task ObjectId() => this.Test(new("652f8c3e8f9b2c1a4d3e6a7b"), supportsAutoGeneration: true);
- [ConditionalFact]
+ [Fact]
public virtual Task String() => this.Test("foo", "bar");
- [ConditionalFact]
+ [Fact]
public virtual Task Int() => this.Test(8);
- [ConditionalFact]
+ [Fact]
public virtual Task Long() => this.Test(8L);
public new class Fixture : KeyTypeTests.Fixture
diff --git a/dotnet/test/VectorData/MongoDB.UnitTests/MongoCollectionTests.cs b/dotnet/test/VectorData/MongoDB.UnitTests/MongoCollectionTests.cs
index 7faaab6e7190..ad91553e0f64 100644
--- a/dotnet/test/VectorData/MongoDB.UnitTests/MongoCollectionTests.cs
+++ b/dotnet/test/VectorData/MongoDB.UnitTests/MongoCollectionTests.cs
@@ -696,11 +696,11 @@ private sealed class VectorSearchModel
[VectorStoreData]
public string? HotelName { get; set; }
- [VectorStoreVector(Dimensions: 4, DistanceFunction = DistanceFunction.CosineDistance, IndexKind = IndexKind.IvfFlat, StorageName = "test_embedding_1")]
+ [VectorStoreVector(dimensions: 4, DistanceFunction = DistanceFunction.CosineDistance, IndexKind = IndexKind.IvfFlat, StorageName = "test_embedding_1")]
public ReadOnlyMemory TestEmbedding1 { get; set; }
[BsonElement("test_embedding_2")]
- [VectorStoreVector(Dimensions: 4, DistanceFunction = DistanceFunction.CosineDistance, IndexKind = IndexKind.IvfFlat)]
+ [VectorStoreVector(dimensions: 4, DistanceFunction = DistanceFunction.CosineDistance, IndexKind = IndexKind.IvfFlat)]
public ReadOnlyMemory TestEmbedding2 { get; set; }
}
#pragma warning restore CA1812
diff --git a/dotnet/test/VectorData/MongoDB.UnitTests/MongoHotelModel.cs b/dotnet/test/VectorData/MongoDB.UnitTests/MongoHotelModel.cs
index 053fe8a3dbbb..f9b0e7bd1797 100644
--- a/dotnet/test/VectorData/MongoDB.UnitTests/MongoHotelModel.cs
+++ b/dotnet/test/VectorData/MongoDB.UnitTests/MongoHotelModel.cs
@@ -39,6 +39,6 @@ public class MongoHotelModel(string hotelId)
public string? Description { get; set; }
/// A vector field.
- [VectorStoreVector(Dimensions: 4, DistanceFunction = DistanceFunction.CosineSimilarity)]
+ [VectorStoreVector(dimensions: 4, DistanceFunction = DistanceFunction.CosineSimilarity)]
public ReadOnlyMemory? DescriptionEmbedding { get; set; }
}
diff --git a/dotnet/test/VectorData/PgVector.ConformanceTests/PgVector.ConformanceTests.csproj b/dotnet/test/VectorData/PgVector.ConformanceTests/PgVector.ConformanceTests.csproj
index 1dac770bbb2f..a855a1fc1c68 100644
--- a/dotnet/test/VectorData/PgVector.ConformanceTests/PgVector.ConformanceTests.csproj
+++ b/dotnet/test/VectorData/PgVector.ConformanceTests/PgVector.ConformanceTests.csproj
@@ -26,7 +26,6 @@
-
diff --git a/dotnet/test/VectorData/PgVector.ConformanceTests/PostgresIndexKindTests.cs b/dotnet/test/VectorData/PgVector.ConformanceTests/PostgresIndexKindTests.cs
index 021cd96a911f..d6e91a258638 100644
--- a/dotnet/test/VectorData/PgVector.ConformanceTests/PostgresIndexKindTests.cs
+++ b/dotnet/test/VectorData/PgVector.ConformanceTests/PostgresIndexKindTests.cs
@@ -4,7 +4,6 @@
using PgVector.ConformanceTests.Support;
using VectorData.ConformanceTests;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace PgVector.ConformanceTests;
@@ -12,7 +11,7 @@ namespace PgVector.ConformanceTests;
public class PostgresIndexKindTests(PostgresIndexKindTests.Fixture fixture)
: IndexKindTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task Hnsw()
=> this.Test(IndexKind.Hnsw);
diff --git a/dotnet/test/VectorData/PgVector.ConformanceTests/TypeTests/PostgresEmbeddingTypeTests.cs b/dotnet/test/VectorData/PgVector.ConformanceTests/TypeTests/PostgresEmbeddingTypeTests.cs
index 8a015c95ce94..c840831a1dc5 100644
--- a/dotnet/test/VectorData/PgVector.ConformanceTests/TypeTests/PostgresEmbeddingTypeTests.cs
+++ b/dotnet/test/VectorData/PgVector.ConformanceTests/TypeTests/PostgresEmbeddingTypeTests.cs
@@ -7,7 +7,6 @@
using PgVector.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
#pragma warning disable CA2000 // Dispose objects before losing scope
@@ -18,35 +17,35 @@ public class PostgresEmbeddingTypeTests(PostgresEmbeddingTypeTests.Fixture fixtu
: EmbeddingTypeTests(fixture), IClassFixture
{
#if NET
- [ConditionalFact]
+ [Fact]
public virtual Task ReadOnlyMemory_of_Half()
=> this.Test>(
new ReadOnlyMemory([(byte)1, (byte)2, (byte)3]),
new ReadOnlyMemoryEmbeddingGenerator([(byte)1, (byte)2, (byte)3]),
vectorEqualityAsserter: (e, a) => Assert.Equal(e.Span.ToArray(), a.Span.ToArray()));
- [ConditionalFact]
+ [Fact]
public virtual Task Embedding_of_Half()
=> this.Test>(
new Embedding(new ReadOnlyMemory([(byte)1, (byte)2, (byte)3])),
new ReadOnlyMemoryEmbeddingGenerator([(byte)1, (byte)2, (byte)3]),
vectorEqualityAsserter: (e, a) => Assert.Equal(e.Vector.Span.ToArray(), a.Vector.Span.ToArray()));
- [ConditionalFact]
+ [Fact]
public virtual Task Array_of_Half()
=> this.Test(
[(byte)1, (byte)2, (byte)3],
new ReadOnlyMemoryEmbeddingGenerator([(byte)1, (byte)2, (byte)3]));
#endif
- [ConditionalFact]
+ [Fact]
public virtual Task BitArray()
=> this.Test(
new BitArray([true, false, true]),
new BinaryEmbeddingGenerator(new BitArray([true, false, true])),
distanceFunction: DistanceFunction.HammingDistance);
- [ConditionalFact]
+ [Fact]
public virtual Task BinaryEmbedding()
=> this.Test(
new BinaryEmbedding(new([true, false, true])),
@@ -54,7 +53,7 @@ public virtual Task BinaryEmbedding()
distanceFunction: DistanceFunction.HammingDistance,
vectorEqualityAsserter: (e, a) => Assert.Equal(e.Vector, a.Vector));
- [ConditionalFact]
+ [Fact]
public virtual Task SparseVector()
=> this.Test(new SparseVector(new ReadOnlyMemory([1, 2, 3])), embeddingGenerator: null);
diff --git a/dotnet/test/VectorData/PgVector.ConformanceTests/TypeTests/PostgresKeyTypeTests.cs b/dotnet/test/VectorData/PgVector.ConformanceTests/TypeTests/PostgresKeyTypeTests.cs
index 659b4d8bdcb6..4efdb86ead54 100644
--- a/dotnet/test/VectorData/PgVector.ConformanceTests/TypeTests/PostgresKeyTypeTests.cs
+++ b/dotnet/test/VectorData/PgVector.ConformanceTests/TypeTests/PostgresKeyTypeTests.cs
@@ -3,7 +3,6 @@
using PgVector.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace PgVector.ConformanceTests.TypeTests;
@@ -11,13 +10,13 @@ namespace PgVector.ConformanceTests.TypeTests;
public class PostgresKeyTypeTests(PostgresKeyTypeTests.Fixture fixture)
: KeyTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task Int() => this.Test(8, supportsAutoGeneration: true);
- [ConditionalFact]
+ [Fact]
public virtual Task Long() => this.Test(8L, supportsAutoGeneration: true);
- [ConditionalFact]
+ [Fact]
public virtual Task String() => this.Test("foo", "bar");
public new class Fixture : KeyTypeTests.Fixture
diff --git a/dotnet/test/VectorData/Pinecone.ConformanceTests/Pinecone.ConformanceTests.csproj b/dotnet/test/VectorData/Pinecone.ConformanceTests/Pinecone.ConformanceTests.csproj
index f6e06ddf3779..3785e8013cdc 100644
--- a/dotnet/test/VectorData/Pinecone.ConformanceTests/Pinecone.ConformanceTests.csproj
+++ b/dotnet/test/VectorData/Pinecone.ConformanceTests/Pinecone.ConformanceTests.csproj
@@ -37,7 +37,6 @@
-
\ No newline at end of file
diff --git a/dotnet/test/VectorData/Pinecone.ConformanceTests/PineconeAllSupportedTypesTests.cs b/dotnet/test/VectorData/Pinecone.ConformanceTests/PineconeAllSupportedTypesTests.cs
index 849425659895..297649f65391 100644
--- a/dotnet/test/VectorData/Pinecone.ConformanceTests/PineconeAllSupportedTypesTests.cs
+++ b/dotnet/test/VectorData/Pinecone.ConformanceTests/PineconeAllSupportedTypesTests.cs
@@ -2,14 +2,13 @@
using Microsoft.Extensions.VectorData;
using Pinecone.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace Pinecone.ConformanceTests;
public class PineconeAllSupportedTypesTests(PineconeFixture fixture) : IClassFixture
{
- [ConditionalFact]
+ [Fact]
public async Task AllTypesBatchGetAsync()
{
var collection = fixture.TestStore.DefaultVectorStore.GetCollection("all-types", PineconeAllTypes.GetRecordDefinition());
diff --git a/dotnet/test/VectorData/Pinecone.ConformanceTests/PineconeFilterTests.cs b/dotnet/test/VectorData/Pinecone.ConformanceTests/PineconeFilterTests.cs
index b20a4d4a5b1d..59d55776af2b 100644
--- a/dotnet/test/VectorData/Pinecone.ConformanceTests/PineconeFilterTests.cs
+++ b/dotnet/test/VectorData/Pinecone.ConformanceTests/PineconeFilterTests.cs
@@ -3,7 +3,6 @@
using Pinecone.ConformanceTests.Support;
using VectorData.ConformanceTests;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace Pinecone.ConformanceTests;
@@ -14,7 +13,7 @@ public class PineconeFilterTests(PineconeFilterTests.Fixture fixture)
: FilterTests(fixture), IClassFixture
{
// Specialized Pinecone syntax for NOT over Contains ($nin)
- [ConditionalFact]
+ [Fact]
public virtual Task Not_over_Contains()
=> this.TestFilterAsync(
r => !new[] { 8, 10 }.Contains(r.Int),
diff --git a/dotnet/test/VectorData/Pinecone.ConformanceTests/PineconeIndexKindTests.cs b/dotnet/test/VectorData/Pinecone.ConformanceTests/PineconeIndexKindTests.cs
index 7bc83979b511..175a74e4ceea 100644
--- a/dotnet/test/VectorData/Pinecone.ConformanceTests/PineconeIndexKindTests.cs
+++ b/dotnet/test/VectorData/Pinecone.ConformanceTests/PineconeIndexKindTests.cs
@@ -3,7 +3,6 @@
using Pinecone.ConformanceTests.Support;
using VectorData.ConformanceTests;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace Pinecone.ConformanceTests;
@@ -14,7 +13,7 @@ public class PineconeIndexKindTests(PineconeIndexKindTests.Fixture fixture)
// Pinecone does not support index-less searching
public override Task Flat() => Assert.ThrowsAsync(base.Flat);
- [ConditionalFact]
+ [Fact]
public virtual Task PGA()
=> this.Test("PGA");
diff --git a/dotnet/test/VectorData/Pinecone.ConformanceTests/Support/PineconeAllTypes.cs b/dotnet/test/VectorData/Pinecone.ConformanceTests/Support/PineconeAllTypes.cs
index 81ed102a6d05..34939433a070 100644
--- a/dotnet/test/VectorData/Pinecone.ConformanceTests/Support/PineconeAllTypes.cs
+++ b/dotnet/test/VectorData/Pinecone.ConformanceTests/Support/PineconeAllTypes.cs
@@ -48,7 +48,7 @@ public record PineconeAllTypes()
[VectorStoreData]
public List? NullableStringList { get; set; }
- [VectorStoreVector(Dimensions: 8, DistanceFunction = DistanceFunction.DotProductSimilarity)]
+ [VectorStoreVector(dimensions: 8, DistanceFunction = DistanceFunction.DotProductSimilarity)]
public ReadOnlyMemory? Embedding { get; set; }
internal void AssertEqual(PineconeAllTypes other)
diff --git a/dotnet/test/VectorData/Pinecone.ConformanceTests/TypeTests/PineconeKeyTypeTests.cs b/dotnet/test/VectorData/Pinecone.ConformanceTests/TypeTests/PineconeKeyTypeTests.cs
index 6dce9486b2b1..77737371cf4e 100644
--- a/dotnet/test/VectorData/Pinecone.ConformanceTests/TypeTests/PineconeKeyTypeTests.cs
+++ b/dotnet/test/VectorData/Pinecone.ConformanceTests/TypeTests/PineconeKeyTypeTests.cs
@@ -3,7 +3,6 @@
using Pinecone.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace Pinecone.ConformanceTests.TypeTests;
@@ -11,7 +10,7 @@ namespace Pinecone.ConformanceTests.TypeTests;
public class PineconeKeyTypeTests(PineconeKeyTypeTests.Fixture fixture)
: KeyTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task String() => this.Test("foo", "bar");
public new class Fixture : KeyTypeTests.Fixture
diff --git a/dotnet/test/VectorData/Qdrant.ConformanceTests/Qdrant.ConformanceTests.csproj b/dotnet/test/VectorData/Qdrant.ConformanceTests/Qdrant.ConformanceTests.csproj
index f664f696500a..d96862e05318 100644
--- a/dotnet/test/VectorData/Qdrant.ConformanceTests/Qdrant.ConformanceTests.csproj
+++ b/dotnet/test/VectorData/Qdrant.ConformanceTests/Qdrant.ConformanceTests.csproj
@@ -22,7 +22,6 @@
-
diff --git a/dotnet/test/VectorData/Qdrant.ConformanceTests/QdrantIndexKindTests.cs b/dotnet/test/VectorData/Qdrant.ConformanceTests/QdrantIndexKindTests.cs
index 398ceb69ec9c..f5a5a93da743 100644
--- a/dotnet/test/VectorData/Qdrant.ConformanceTests/QdrantIndexKindTests.cs
+++ b/dotnet/test/VectorData/Qdrant.ConformanceTests/QdrantIndexKindTests.cs
@@ -4,7 +4,6 @@
using Qdrant.ConformanceTests.Support;
using VectorData.ConformanceTests;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace Qdrant.ConformanceTests;
@@ -15,7 +14,7 @@ public class QdrantIndexKindTests(QdrantIndexKindTests.Fixture fixture)
// Qdrant does not support index-less searching
public override Task Flat() => Assert.ThrowsAsync(base.Flat);
- [ConditionalFact]
+ [Fact]
public virtual Task Hnsw()
=> this.Test(IndexKind.Hnsw);
diff --git a/dotnet/test/VectorData/Qdrant.ConformanceTests/TypeTests/QdrantDataTypeTests.cs b/dotnet/test/VectorData/Qdrant.ConformanceTests/TypeTests/QdrantDataTypeTests.cs
index fcd8f55566ef..65d3caa82f70 100644
--- a/dotnet/test/VectorData/Qdrant.ConformanceTests/TypeTests/QdrantDataTypeTests.cs
+++ b/dotnet/test/VectorData/Qdrant.ConformanceTests/TypeTests/QdrantDataTypeTests.cs
@@ -3,7 +3,6 @@
using Qdrant.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace Qdrant.ConformanceTests.TypeTests;
@@ -13,15 +12,15 @@ public class QdrantDataTypeTests(QdrantDataTypeTests.Fixture fixture)
{
// Qdrant doesn't seem to support filtering on float/double or string ararys,
// https://qdrant.tech/documentation/concepts/filtering/#match
- [ConditionalFact]
+ [Fact]
public override Task Float()
=> this.Test("Float", 8.5f, 9.5f, isFilterable: false);
- [ConditionalFact]
+ [Fact]
public override Task Double()
=> this.Test("Double", 8.5d, 9.5d, isFilterable: false);
- [ConditionalFact]
+ [Fact]
public override Task String_array()
=> this.Test(
"StringArray",
diff --git a/dotnet/test/VectorData/Qdrant.ConformanceTests/TypeTests/QdrantKeyTypeTests.cs b/dotnet/test/VectorData/Qdrant.ConformanceTests/TypeTests/QdrantKeyTypeTests.cs
index 6594bddb3e35..45746f2874e6 100644
--- a/dotnet/test/VectorData/Qdrant.ConformanceTests/TypeTests/QdrantKeyTypeTests.cs
+++ b/dotnet/test/VectorData/Qdrant.ConformanceTests/TypeTests/QdrantKeyTypeTests.cs
@@ -3,7 +3,6 @@
using Qdrant.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace Qdrant.ConformanceTests.TypeTests;
@@ -11,7 +10,7 @@ namespace Qdrant.ConformanceTests.TypeTests;
public class QdrantKeyTypeTests(QdrantKeyTypeTests.Fixture fixture)
: KeyTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task ULong() => this.Test(8UL);
public new class Fixture : KeyTypeTests.Fixture
diff --git a/dotnet/test/VectorData/Redis.ConformanceTests/Redis.ConformanceTests.csproj b/dotnet/test/VectorData/Redis.ConformanceTests/Redis.ConformanceTests.csproj
index 81fd4c52d7df..18c4c492dac4 100644
--- a/dotnet/test/VectorData/Redis.ConformanceTests/Redis.ConformanceTests.csproj
+++ b/dotnet/test/VectorData/Redis.ConformanceTests/Redis.ConformanceTests.csproj
@@ -21,7 +21,6 @@
-
diff --git a/dotnet/test/VectorData/Redis.ConformanceTests/RedisJsonOptionsTests.cs b/dotnet/test/VectorData/Redis.ConformanceTests/RedisJsonOptionsTests.cs
index 4743183b1389..ed36c841354e 100644
--- a/dotnet/test/VectorData/Redis.ConformanceTests/RedisJsonOptionsTests.cs
+++ b/dotnet/test/VectorData/Redis.ConformanceTests/RedisJsonOptionsTests.cs
@@ -6,7 +6,6 @@
using Redis.ConformanceTests.Support;
using StackExchange.Redis;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace Redis.ConformanceTests;
@@ -14,7 +13,7 @@ namespace Redis.ConformanceTests;
public sealed class RedisJsonOptionsTests(RedisJsonOptionsTests.Fixture fixture)
: IClassFixture
{
- [ConditionalFact]
+ [Fact]
public async Task Json_collection_with_prefix_and_nested_address_roundtrips()
{
var store = (RedisTestStore)fixture.TestStore;
@@ -54,7 +53,7 @@ public async Task Json_collection_with_prefix_and_nested_address_roundtrips()
}
}
- [ConditionalFact]
+ [Fact]
public async Task Json_collection_get_throws_for_invalid_schema()
{
var store = (RedisTestStore)fixture.TestStore;
diff --git a/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisHashSetEmbeddingTypeTests.cs b/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisHashSetEmbeddingTypeTests.cs
index dfbc028c0dc9..92c28cf50d10 100644
--- a/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisHashSetEmbeddingTypeTests.cs
+++ b/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisHashSetEmbeddingTypeTests.cs
@@ -4,7 +4,6 @@
using Redis.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
#pragma warning disable CA2000 // Dispose objects before losing scope
@@ -14,21 +13,21 @@ namespace Redis.ConformanceTests.TypeTests;
public class RedisHashSetEmbeddingTypeTests(RedisHashSetEmbeddingTypeTests.Fixture fixture)
: EmbeddingTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task ReadOnlyMemory_of_double()
=> this.Test>(
new ReadOnlyMemory([1d, 2d, 3d]),
new ReadOnlyMemoryEmbeddingGenerator([1d, 2d, 3d]),
vectorEqualityAsserter: (e, a) => Assert.Equal(e.Span.ToArray(), a.Span.ToArray()));
- [ConditionalFact]
+ [Fact]
public virtual Task Embedding_of_double()
=> this.Test>(
new Embedding(new ReadOnlyMemory([1, 2, 3])),
new ReadOnlyMemoryEmbeddingGenerator([1, 2, 3]),
vectorEqualityAsserter: (e, a) => Assert.Equal(e.Vector.Span.ToArray(), a.Vector.Span.ToArray()));
- [ConditionalFact]
+ [Fact]
public virtual Task Array_of_double()
=> this.Test(
[1, 2, 3],
diff --git a/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisHashSetKeyTypeTests.cs b/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisHashSetKeyTypeTests.cs
index bbf40144fea9..876924ff11c4 100644
--- a/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisHashSetKeyTypeTests.cs
+++ b/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisHashSetKeyTypeTests.cs
@@ -4,7 +4,6 @@
using Redis.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace Redis.ConformanceTests.TypeTests;
@@ -12,7 +11,7 @@ namespace Redis.ConformanceTests.TypeTests;
public class RedisHashSetKeyTypeTests(RedisHashSetKeyTypeTests.Fixture fixture)
: KeyTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task String() => this.Test("foo", "bar");
public new class Fixture : KeyTypeTests.Fixture
diff --git a/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisJsonEmbeddingTypeTests.cs b/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisJsonEmbeddingTypeTests.cs
index 090b94c8e88c..169ae0c59a32 100644
--- a/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisJsonEmbeddingTypeTests.cs
+++ b/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisJsonEmbeddingTypeTests.cs
@@ -4,7 +4,6 @@
using Redis.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
#pragma warning disable CA2000 // Dispose objects before losing scope
@@ -14,21 +13,21 @@ namespace Redis.ConformanceTests.TypeTests;
public class RedisJsonEmbeddingTypeTests(RedisJsonEmbeddingTypeTests.Fixture fixture)
: EmbeddingTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task ReadOnlyMemory_of_double()
=> this.Test>(
new ReadOnlyMemory([1d, 2d, 3d]),
new ReadOnlyMemoryEmbeddingGenerator([1d, 2d, 3d]),
vectorEqualityAsserter: (e, a) => Assert.Equal(e.Span.ToArray(), a.Span.ToArray()));
- [ConditionalFact]
+ [Fact]
public virtual Task Embedding_of_double()
=> this.Test>(
new Embedding(new ReadOnlyMemory([1, 2, 3])),
new ReadOnlyMemoryEmbeddingGenerator([1, 2, 3]),
vectorEqualityAsserter: (e, a) => Assert.Equal(e.Vector.Span.ToArray(), a.Vector.Span.ToArray()));
- [ConditionalFact]
+ [Fact]
public virtual Task Array_of_double()
=> this.Test(
[1, 2, 3],
diff --git a/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisJsonKeyTypeTests.cs b/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisJsonKeyTypeTests.cs
index ecc2030a65e2..7831e785108c 100644
--- a/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisJsonKeyTypeTests.cs
+++ b/dotnet/test/VectorData/Redis.ConformanceTests/TypeTests/RedisJsonKeyTypeTests.cs
@@ -4,7 +4,6 @@
using Redis.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace Redis.ConformanceTests.TypeTests;
@@ -12,7 +11,7 @@ namespace Redis.ConformanceTests.TypeTests;
public class RedisJsonKeyTypeTests(RedisJsonKeyTypeTests.Fixture fixture)
: KeyTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task String() => this.Test("foo", "bar");
public new class Fixture : KeyTypeTests.Fixture
diff --git a/dotnet/test/VectorData/SqlServer.ConformanceTests/ModelTests/SqlServerBasicModelTests.cs b/dotnet/test/VectorData/SqlServer.ConformanceTests/ModelTests/SqlServerBasicModelTests.cs
index 4202035a649d..4118de03dd02 100644
--- a/dotnet/test/VectorData/SqlServer.ConformanceTests/ModelTests/SqlServerBasicModelTests.cs
+++ b/dotnet/test/VectorData/SqlServer.ConformanceTests/ModelTests/SqlServerBasicModelTests.cs
@@ -4,7 +4,6 @@
using SqlServer.ConformanceTests.Support;
using VectorData.ConformanceTests.ModelTests;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace SqlServer.ConformanceTests.ModelTests;
@@ -14,7 +13,7 @@ public class SqlServerBasicModelTests(SqlServerBasicModelTests.Fixture fixture)
{
private const int SqlServerMaxParameters = 2_100;
- [ConditionalFact]
+ [Fact]
private async Task Split_batches_to_account_for_max_parameter_limit()
{
var collection = fixture.Collection;
@@ -43,7 +42,7 @@ private async Task Split_batches_to_account_for_max_parameter_limit()
Assert.Empty(await collection.GetAsync(keys).ToArrayAsync());
}
- [ConditionalFact]
+ [Fact]
public async Task Upsert_batch_is_atomic()
{
var collection = fixture.Collection;
diff --git a/dotnet/test/VectorData/SqlServer.ConformanceTests/SqlServer.ConformanceTests.csproj b/dotnet/test/VectorData/SqlServer.ConformanceTests/SqlServer.ConformanceTests.csproj
index af2ed087924f..77c39df13afa 100644
--- a/dotnet/test/VectorData/SqlServer.ConformanceTests/SqlServer.ConformanceTests.csproj
+++ b/dotnet/test/VectorData/SqlServer.ConformanceTests/SqlServer.ConformanceTests.csproj
@@ -34,7 +34,6 @@
-
diff --git a/dotnet/test/VectorData/SqlServer.ConformanceTests/SqlServerDiskAnnVectorSearchTests.cs b/dotnet/test/VectorData/SqlServer.ConformanceTests/SqlServerDiskAnnVectorSearchTests.cs
index bf661df40b87..a669087055a7 100644
--- a/dotnet/test/VectorData/SqlServer.ConformanceTests/SqlServerDiskAnnVectorSearchTests.cs
+++ b/dotnet/test/VectorData/SqlServer.ConformanceTests/SqlServerDiskAnnVectorSearchTests.cs
@@ -14,7 +14,6 @@
using Microsoft.Extensions.VectorData;
using SqlServer.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace SqlServer.ConformanceTests;
@@ -29,7 +28,7 @@ public class SqlServerDiskAnnVectorSearchTests(
/// Tests that approximate vector search via VECTOR_SEARCH() returns correct results
/// when a DiskANN index exists on the table.
///
- [ConditionalFact]
+ [Fact]
public async Task VectorSearch_WithDiskAnnIndex()
{
using var collection = this.CreateDiskAnnCollection();
@@ -44,7 +43,7 @@ public async Task VectorSearch_WithDiskAnnIndex()
///
/// Tests that VECTOR_SEARCH() correctly returns multiple results ordered by distance.
///
- [ConditionalFact]
+ [Fact]
public async Task VectorSearch_WithDiskAnnIndex_TopN()
{
using var collection = this.CreateDiskAnnCollection();
@@ -61,7 +60,7 @@ public async Task VectorSearch_WithDiskAnnIndex_TopN()
/// Tests that VECTOR_SEARCH() throws when a LINQ filter is specified,
/// since SQL Server's VECTOR_SEARCH only supports post-filtering.
///
- [ConditionalFact]
+ [Fact]
public async Task VectorSearch_WithDiskAnnIndex_WithFilter_Throws()
{
using var collection = this.CreateDiskAnnCollection();
diff --git a/dotnet/test/VectorData/SqlServer.ConformanceTests/SqlServerIndexKindTests.cs b/dotnet/test/VectorData/SqlServer.ConformanceTests/SqlServerIndexKindTests.cs
index e17de1f54393..6865dc92e178 100644
--- a/dotnet/test/VectorData/SqlServer.ConformanceTests/SqlServerIndexKindTests.cs
+++ b/dotnet/test/VectorData/SqlServer.ConformanceTests/SqlServerIndexKindTests.cs
@@ -4,7 +4,6 @@
using SqlServer.ConformanceTests.Support;
using VectorData.ConformanceTests;
using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace SqlServer.ConformanceTests;
@@ -15,7 +14,7 @@ public class SqlServerIndexKindTests(SqlServerIndexKindTests.Fixture fixture)
// SQL Server 2025 currently makes tables with vector indexes read-only, so data must be inserted before
// the index is created. See SqlServerDiskAnnVectorSearchTests for a temporary workaround test that inserts
// data first and then creates the index. Remove the Skip and delete that class once this limitation is lifted.
- [ConditionalFact(Skip = "SQL Server 2025 read-only vector index limitation; see SqlServerDiskAnnVectorSearchTests")]
+ [Fact(Skip = "SQL Server 2025 read-only vector index limitation; see SqlServerDiskAnnVectorSearchTests")]
public virtual Task DiskAnn()
=> this.Test(IndexKind.DiskAnn);
diff --git a/dotnet/test/VectorData/SqlServer.ConformanceTests/TypeTests/SqlServerEmbeddingTypeTests.cs b/dotnet/test/VectorData/SqlServer.ConformanceTests/TypeTests/SqlServerEmbeddingTypeTests.cs
index 4a939691da9d..ca33bf98df1b 100644
--- a/dotnet/test/VectorData/SqlServer.ConformanceTests/TypeTests/SqlServerEmbeddingTypeTests.cs
+++ b/dotnet/test/VectorData/SqlServer.ConformanceTests/TypeTests/SqlServerEmbeddingTypeTests.cs
@@ -4,7 +4,6 @@
using SqlServer.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
#pragma warning disable CA2000 // Dispose objects before losing scope
@@ -14,7 +13,7 @@ namespace SqlServer.ConformanceTests.TypeTests;
public class SqlServerEmbeddingTypeTests(SqlServerEmbeddingTypeTests.Fixture fixture)
: EmbeddingTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task SqlVector_of_float()
=> this.Test>(
new SqlVector(new float[] { 1, 2, 3 }),
diff --git a/dotnet/test/VectorData/SqlServer.ConformanceTests/TypeTests/SqlServerKeyTypeTests.cs b/dotnet/test/VectorData/SqlServer.ConformanceTests/TypeTests/SqlServerKeyTypeTests.cs
index 27d5d2019eb2..5cc312e36afc 100644
--- a/dotnet/test/VectorData/SqlServer.ConformanceTests/TypeTests/SqlServerKeyTypeTests.cs
+++ b/dotnet/test/VectorData/SqlServer.ConformanceTests/TypeTests/SqlServerKeyTypeTests.cs
@@ -3,7 +3,6 @@
using SqlServer.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace SqlServer.ConformanceTests.TypeTests;
@@ -11,13 +10,13 @@ namespace SqlServer.ConformanceTests.TypeTests;
public class SqlServerKeyTypeTests(SqlServerKeyTypeTests.Fixture fixture)
: KeyTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task Int() => this.Test(8, supportsAutoGeneration: true);
- [ConditionalFact]
+ [Fact]
public virtual Task Long() => this.Test(8L, supportsAutoGeneration: true);
- [ConditionalFact]
+ [Fact]
public virtual Task String() => this.Test("foo", "bar");
public new class Fixture : KeyTypeTests.Fixture
diff --git a/dotnet/test/VectorData/SqliteVec.ConformanceTests/Properties/AssemblyAttributes.cs b/dotnet/test/VectorData/SqliteVec.ConformanceTests/Properties/AssemblyAttributes.cs
index ffcc58e906c3..d26685815cb0 100644
--- a/dotnet/test/VectorData/SqliteVec.ConformanceTests/Properties/AssemblyAttributes.cs
+++ b/dotnet/test/VectorData/SqliteVec.ConformanceTests/Properties/AssemblyAttributes.cs
@@ -2,6 +2,5 @@
using Xunit;
-[assembly: SqliteVec.ConformanceTests.Support.SqliteVecRequired]
// Disable test parallelization in order to prevent from "database is locked" errors
[assembly: CollectionBehavior(DisableTestParallelization = true)]
diff --git a/dotnet/test/VectorData/SqliteVec.ConformanceTests/SqliteVec.ConformanceTests.csproj b/dotnet/test/VectorData/SqliteVec.ConformanceTests/SqliteVec.ConformanceTests.csproj
index ab89ee34cb9e..341a3eca871c 100644
--- a/dotnet/test/VectorData/SqliteVec.ConformanceTests/SqliteVec.ConformanceTests.csproj
+++ b/dotnet/test/VectorData/SqliteVec.ConformanceTests/SqliteVec.ConformanceTests.csproj
@@ -20,7 +20,6 @@
-
diff --git a/dotnet/test/VectorData/SqliteVec.ConformanceTests/Support/SqliteVecRequiredAttribute.cs b/dotnet/test/VectorData/SqliteVec.ConformanceTests/Support/SqliteVecRequiredAttribute.cs
deleted file mode 100644
index 107a1e306f02..000000000000
--- a/dotnet/test/VectorData/SqliteVec.ConformanceTests/Support/SqliteVecRequiredAttribute.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using VectorData.ConformanceTests.Xunit;
-
-namespace SqliteVec.ConformanceTests.Support;
-
-///
-/// Checks whether the sqlite_vec extension is properly installed, and skips the test(s) otherwise.
-///
-[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)]
-public sealed class SqliteVecRequiredAttribute : Attribute, ITestCondition
-{
- public ValueTask IsMetAsync() => new(SqliteTestEnvironment.CanUseSqlite);
-
- public string Skip { get; set; } = "Some native Sqlite dependencies are missing.";
-
- public string SkipReason
- => this.Skip;
-}
diff --git a/dotnet/test/VectorData/SqliteVec.ConformanceTests/TypeTests/SqliteKeyTypeTests.cs b/dotnet/test/VectorData/SqliteVec.ConformanceTests/TypeTests/SqliteKeyTypeTests.cs
index 8561d6eaba9e..7d1914e452d9 100644
--- a/dotnet/test/VectorData/SqliteVec.ConformanceTests/TypeTests/SqliteKeyTypeTests.cs
+++ b/dotnet/test/VectorData/SqliteVec.ConformanceTests/TypeTests/SqliteKeyTypeTests.cs
@@ -3,7 +3,6 @@
using SqliteVec.ConformanceTests.Support;
using VectorData.ConformanceTests.Support;
using VectorData.ConformanceTests.TypeTests;
-using VectorData.ConformanceTests.Xunit;
using Xunit;
namespace SqliteVec.ConformanceTests.TypeTests;
@@ -11,13 +10,13 @@ namespace SqliteVec.ConformanceTests.TypeTests;
public class SqliteKeyTypeTests(SqliteKeyTypeTests.Fixture fixture)
: KeyTypeTests(fixture), IClassFixture
{
- [ConditionalFact]
+ [Fact]
public virtual Task Int() => this.Test(8, supportsAutoGeneration: true);
- [ConditionalFact]
+ [Fact]
public virtual Task Long() => this.Test(8L, supportsAutoGeneration: true);
- [ConditionalFact]
+ [Fact]
public virtual Task String() => this.Test("foo", "bar");
public new class Fixture : KeyTypeTests.Fixture
diff --git a/dotnet/test/VectorData/SqliteVec.UnitTests/SqliteHotel.cs b/dotnet/test/VectorData/SqliteVec.UnitTests/SqliteHotel.cs
index 1df5691074b1..cad3e15ac695 100644
--- a/dotnet/test/VectorData/SqliteVec.UnitTests/SqliteHotel.cs
+++ b/dotnet/test/VectorData/SqliteVec.UnitTests/SqliteHotel.cs
@@ -32,6 +32,6 @@ public class SqliteHotel()
public string? Description { get; set; }
/// A vector field.
- [VectorStoreVector(Dimensions: 4, DistanceFunction = DistanceFunction.EuclideanDistance)]
+ [VectorStoreVector(dimensions: 4, DistanceFunction = DistanceFunction.EuclideanDistance)]
public ReadOnlyMemory? DescriptionEmbedding { get; set; }
}
diff --git a/dotnet/test/VectorData/VectorData.ConformanceTests/CollectionManagementTests.cs b/dotnet/test/VectorData/VectorData.ConformanceTests/CollectionManagementTests.cs
deleted file mode 100644
index 1e32e41f37a6..000000000000
--- a/dotnet/test/VectorData/VectorData.ConformanceTests/CollectionManagementTests.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using Microsoft.Extensions.VectorData;
-using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
-using Xunit;
-
-namespace VectorData.ConformanceTests;
-
-public abstract class CollectionManagementTests(VectorStoreFixture fixture) : IAsyncLifetime
- where TKey : notnull
-{
- public Task InitializeAsync()
- => fixture.VectorStore.EnsureCollectionDeletedAsync(this.CollectionName);
-
- [ConditionalFact]
- public async Task Collection_Ensure_Exists_Delete()
- {
- var collection = this.GetCollection();
-
- Assert.False(await collection.CollectionExistsAsync());
- await collection.EnsureCollectionExistsAsync();
- Assert.True(await collection.CollectionExistsAsync());
- await collection.EnsureCollectionDeletedAsync();
- Assert.False(await collection.CollectionExistsAsync());
-
- // Deleting a non-existing collection does not throw
- await fixture.TestStore.DefaultVectorStore.EnsureCollectionDeletedAsync(collection.Name);
- }
-
- [ConditionalFact]
- public async Task EnsureCollectionExists_twice_does_not_throw()
- {
- var collection = this.GetCollection();
-
- await collection.EnsureCollectionExistsAsync();
- await collection.EnsureCollectionExistsAsync();
- Assert.True(await collection.CollectionExistsAsync());
- }
-
- [ConditionalFact]
- public async Task Store_CollectionExists()
- {
- var store = fixture.VectorStore;
- var collection = this.GetCollection();
-
- Assert.False(await store.CollectionExistsAsync(collection.Name));
- await collection.EnsureCollectionExistsAsync();
- Assert.True(await store.CollectionExistsAsync(collection.Name));
- }
-
- [ConditionalFact]
- public async Task Store_DeleteCollection()
- {
- var store = fixture.VectorStore;
- var collection = this.GetCollection();
-
- await collection.EnsureCollectionExistsAsync();
- await fixture.TestStore.DefaultVectorStore.EnsureCollectionDeletedAsync(collection.Name);
- Assert.False(await collection.CollectionExistsAsync());
- }
-
- [ConditionalFact]
- public async Task Store_ListCollections()
- {
- var store = fixture.VectorStore;
- var collection = this.GetCollection();
-
- Assert.Empty(await store.ListCollectionNamesAsync().Where(n => n == collection.Name).ToListAsync());
-
- await collection.EnsureCollectionExistsAsync();
-
- var name = Assert.Single(await store.ListCollectionNamesAsync().Where(n => n == collection.Name).ToListAsync());
- Assert.Equal(collection.Name, name);
- }
-
- [ConditionalFact]
- public void Collection_metadata()
- {
- var collection = this.GetCollection();
-
- var collectionMetadata = (VectorStoreCollectionMetadata?)collection.GetService(typeof(VectorStoreCollectionMetadata));
-
- Assert.NotNull(collectionMetadata);
- Assert.NotNull(collectionMetadata.VectorStoreSystemName);
- Assert.NotNull(collectionMetadata.CollectionName);
- }
-
- protected virtual string CollectionNameBase => nameof(CollectionManagementTests);
- public virtual string CollectionName => fixture.TestStore.AdjustCollectionName(this.CollectionNameBase);
-
- public sealed class Record : TestRecord
- {
- public string? Text { get; set; }
- public int Number { get; set; }
- public ReadOnlyMemory Floats { get; set; }
- }
-
- public virtual VectorStoreCollection GetCollection()
- => fixture.TestStore.CreateCollection(this.CollectionName, this.CreateRecordDefinition());
-
- public virtual VectorStoreCollectionDefinition CreateRecordDefinition()
- => new()
- {
- Properties =
- [
- new VectorStoreKeyProperty(nameof(Record.Key), typeof(TKey)) { StorageName = "key" },
- new VectorStoreDataProperty(nameof(Record.Text), typeof(string)) { StorageName = "text" },
- new VectorStoreDataProperty(nameof(Record.Number), typeof(int)) { StorageName = "number" },
- new VectorStoreVectorProperty(nameof(Record.Floats), typeof(ReadOnlyMemory), 10) { IndexKind = fixture.TestStore.DefaultIndexKind }
- ]
- };
-
- public Task DisposeAsync() => Task.CompletedTask;
-}
diff --git a/dotnet/test/VectorData/VectorData.ConformanceTests/DependencyInjectionTests.cs b/dotnet/test/VectorData/VectorData.ConformanceTests/DependencyInjectionTests.cs
deleted file mode 100644
index 1a0bb1493785..000000000000
--- a/dotnet/test/VectorData/VectorData.ConformanceTests/DependencyInjectionTests.cs
+++ /dev/null
@@ -1,283 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using System.Linq.Expressions;
-using Microsoft.Extensions.AI;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.VectorData;
-using VectorData.ConformanceTests.Support;
-using Xunit;
-
-namespace VectorData.ConformanceTests;
-
-// The type argument object? might not be serializable, which may cause Test Explorer to not enumerate individual data rows. Consider using a type that is known to be serializable.
-#pragma warning disable xUnit1045
-
-public abstract class DependencyInjectionTests : DependencyInjectionTests
- where TVectorStore : VectorStore
- where TCollection : VectorStoreCollection
- where TKey : notnull
- where TRecord : class
-{
- protected virtual string CollectionName => "collectionName";
-
- protected abstract void PopulateConfiguration(ConfigurationManager configuration, object? serviceKey = null);
-
- public abstract IEnumerable> StoreDelegates { get; }
-
- public abstract IEnumerable> CollectionDelegates { get; }
-
- [Fact]
- public void ServiceCollectionCantBeNull()
- {
- foreach (var registrationDelegate in this.StoreDelegates)
- {
- Assert.Throws(() => registrationDelegate(null!, null, ServiceLifetime.Singleton));
- Assert.Throws(() => registrationDelegate(null!, "serviceKey", ServiceLifetime.Singleton));
- }
-
- foreach (var registrationDelegate in this.CollectionDelegates)
- {
- Assert.Throws(() => registrationDelegate(null!, null, this.CollectionName, ServiceLifetime.Singleton));
- Assert.Throws(() => registrationDelegate(null!, "serviceKey", this.CollectionName, ServiceLifetime.Singleton));
- }
- }
-
- [Fact]
- public void CollectionNameCantBeNullOrEmpty()
- {
- const string EmptyCollectionName = "";
-
- foreach (var registrationDelegate in this.CollectionDelegates)
- {
- IServiceCollection services = this.CreateServices();
-
- Assert.Throws(() => registrationDelegate(services, null, null!, ServiceLifetime.Singleton));
- Assert.Throws(() => registrationDelegate(services, "serviceKey", null!, ServiceLifetime.Singleton));
- Assert.Throws(() => registrationDelegate(services, null, EmptyCollectionName, ServiceLifetime.Singleton));
- Assert.Throws(() => registrationDelegate(services, "serviceKey", EmptyCollectionName, ServiceLifetime.Singleton));
- }
- }
-
- [Theory, MemberData(nameof(LifetimesAndServiceKeys))]
- public virtual void CanRegisterVectorStore(ServiceLifetime lifetime, object? serviceKey)
- {
- foreach (var registrationDelegate in this.StoreDelegates)
- {
- IServiceCollection services = this.CreateServices(serviceKey);
-
- registrationDelegate(services, serviceKey, lifetime);
-
- using ServiceProvider serviceProvider = services.BuildServiceProvider();
- // let's ensure that concrete types are registered
- Verify(serviceProvider, lifetime, serviceKey);
- // and the abstraction too
- Verify(serviceProvider, lifetime, serviceKey);
- }
- }
-
- [Theory, MemberData(nameof(LifetimesAndServiceKeys))]
- public void CanRegisterCollections(ServiceLifetime lifetime, object? serviceKey)
- {
- foreach (var registrationDelegate in this.CollectionDelegates)
- {
- IServiceCollection services = this.CreateServices(serviceKey);
-
- registrationDelegate(services, serviceKey, this.CollectionName, lifetime);
-
- using ServiceProvider serviceProvider = services.BuildServiceProvider();
- // Let's ensure that concrete types are registered.
- Verify(serviceProvider, lifetime, serviceKey);
- // And the VectorStoreCollection abstraction.
- Verify>(serviceProvider, lifetime, serviceKey);
- // And the IVectorSearchable abstraction.
- Verify>(serviceProvider, lifetime, serviceKey);
-
- if (typeof(IKeywordHybridSearchable).IsAssignableFrom(typeof(TCollection)))
- {
- Verify>(serviceProvider, lifetime, serviceKey);
- }
- else
- {
- Assert.Null(serviceProvider.GetService>());
- }
- }
- }
-
- [Theory, MemberData(nameof(LifetimesAndServiceKeys))]
- public virtual void CanRegisterConcreteTypeVectorStoreAfterSomeAbstractionHasBeenRegistered(ServiceLifetime lifetime, object? serviceKey)
- {
- foreach (var registrationDelegate in this.StoreDelegates)
- {
- IServiceCollection services = this.CreateServices(serviceKey);
-
- // Users may be willing to register more than one IVectorStore implementation.
- services.Add(new ServiceDescriptor(typeof(VectorStore), serviceKey, (sp, key) => new FakeVectorStore(), lifetime));
-
- registrationDelegate(services, serviceKey, lifetime);
-
- using ServiceProvider serviceProvider = services.BuildServiceProvider();
- // let's ensure that concrete types are registered
- Verify(serviceProvider, lifetime, serviceKey);
- }
- }
-
- [Theory, MemberData(nameof(LifetimesAndServiceKeys))]
- public void CanRegisterConcreteTypeCollectionsAfterSomeAbstractionHasBeenRegistered(ServiceLifetime lifetime, object? serviceKey)
- {
- foreach (var registrationDelegate in this.CollectionDelegates)
- {
- IServiceCollection services = this.CreateServices(serviceKey);
-
- // Users may be willing to register more than one VectorStoreCollection implementation.
- services.Add(new ServiceDescriptor(typeof(VectorStoreCollection), serviceKey, (sp, key) => new FakeVectorStoreRecordCollection(), lifetime));
-
- registrationDelegate(services, serviceKey, this.CollectionName, lifetime);
-
- using ServiceProvider serviceProvider = services.BuildServiceProvider();
- // let's ensure that concrete types are registered
- Verify(serviceProvider, lifetime, serviceKey);
- }
- }
-
- [Theory, MemberData(nameof(LifetimesAndServiceKeys))]
- public void EmbeddingGeneratorIsResolved(ServiceLifetime lifetime, object? serviceKey)
- {
- foreach (var registrationDelegate in this.CollectionDelegates)
- {
- IServiceCollection services = this.CreateServices(serviceKey);
-
- bool wasResolved = false;
- services.AddSingleton(sp =>
- {
- wasResolved = true;
- return null!;
- });
-
- registrationDelegate(services, serviceKey, this.CollectionName, lifetime);
-
- Assert.False(wasResolved); // it's lazy
-
- using ServiceProvider serviceProvider = services.BuildServiceProvider();
- using var collection = serviceKey is null
- ? serviceProvider.GetRequiredService()
- : serviceProvider.GetRequiredKeyedService(serviceKey);
-
- Assert.True(wasResolved);
- }
- }
-
-#pragma warning disable CA1000 // Do not declare static members on generic types
- public static TheoryData LifetimesAndServiceKeys { get; } = GetLifetimesAndServiceKeys();
-#pragma warning restore CA1000 // Do not declare static members on generic types
-
- private static TheoryData GetLifetimesAndServiceKeys()
- {
- TheoryData result = [];
-
- foreach (ServiceLifetime lifetime in new ServiceLifetime[] { ServiceLifetime.Scoped, ServiceLifetime.Singleton, ServiceLifetime.Transient })
- {
- result.Add(lifetime, null);
- result.Add(lifetime, "key");
- result.Add(lifetime, 8);
- }
-
- return result;
- }
-
- protected IServiceCollection CreateServices(object? serviceKey = null)
- {
- IServiceCollection services = new ServiceCollection();
-#pragma warning disable CA2000 // Dispose objects before losing scope
- ConfigurationManager configuration = new();
-#pragma warning restore CA2000 // Dispose objects before losing scope
- services.AddSingleton(configuration);
-
- this.PopulateConfiguration(configuration, serviceKey);
-
- return services;
- }
-
- private static void Verify(ServiceProvider serviceProvider, ServiceLifetime lifetime, object? serviceKey)
- where TService : class
- {
- TService? serviceFromFirstScope, serviceFromSecondScope, secondServiceFromSecondScope;
-
- using (IServiceScope scope1 = serviceProvider.CreateScope())
- {
- serviceFromFirstScope = Resolve(scope1.ServiceProvider, serviceKey);
- }
-
- using (IServiceScope scope2 = serviceProvider.CreateScope())
- {
- serviceFromSecondScope = Resolve(scope2.ServiceProvider, serviceKey);
-
- secondServiceFromSecondScope = Resolve(scope2.ServiceProvider, serviceKey);
- }
-
- Assert.NotNull(serviceFromFirstScope);
- Assert.NotNull(serviceFromSecondScope);
- Assert.NotNull(secondServiceFromSecondScope);
-
- switch (lifetime)
- {
- case ServiceLifetime.Singleton:
- Assert.Same(serviceFromFirstScope, serviceFromSecondScope);
- Assert.Same(serviceFromSecondScope, secondServiceFromSecondScope);
- break;
- case ServiceLifetime.Scoped:
- Assert.NotSame(serviceFromFirstScope, serviceFromSecondScope);
- Assert.Same(serviceFromSecondScope, secondServiceFromSecondScope);
- break;
- case ServiceLifetime.Transient:
- Assert.NotSame(serviceFromFirstScope, serviceFromSecondScope);
- Assert.NotSame(serviceFromSecondScope, secondServiceFromSecondScope);
- break;
- }
- }
-
- protected static string CreateConfigKey(string prefix, object? serviceKey, string suffix)
- => serviceKey is null ? $"{prefix}:{suffix}" : $"{prefix}:{serviceKey}:{suffix}";
-
- private static TService Resolve(IServiceProvider serviceProvider, object? serviceKey = null) where TService : notnull
- => serviceKey is null
- ? serviceProvider.GetRequiredService()
- : serviceProvider.GetRequiredKeyedService(serviceKey);
-
- private sealed class FakeVectorStore : VectorStore
- {
- public override Task CollectionExistsAsync(string name, CancellationToken cancellationToken = default) => throw new NotImplementedException();
- public override Task EnsureCollectionDeletedAsync(string name, CancellationToken cancellationToken = default) => throw new NotImplementedException();
- public override VectorStoreCollection GetCollection(string name, VectorStoreCollectionDefinition? definition = null) => throw new NotImplementedException();
- public override VectorStoreCollection> GetDynamicCollection(string name, VectorStoreCollectionDefinition? definition = null) => throw new NotImplementedException();
- public override object? GetService(Type serviceType, object? serviceKey = null) => throw new NotImplementedException();
- public override IAsyncEnumerable ListCollectionNamesAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException();
- }
-
- private sealed class FakeVectorStoreRecordCollection : VectorStoreCollection
- {
- public override string Name => throw new NotImplementedException();
- public override Task CollectionExistsAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException();
- public override Task EnsureCollectionExistsAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException();
- public override Task DeleteAsync(TKey key, CancellationToken cancellationToken = default) => throw new NotImplementedException();
- public override Task EnsureCollectionDeletedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException();
- public override Task GetAsync(TKey key, RecordRetrievalOptions? options = null, CancellationToken cancellationToken = default) => throw new NotImplementedException();
- public override IAsyncEnumerable GetAsync(Expression> filter, int top, FilteredRecordRetrievalOptions? options = null, CancellationToken cancellationToken = default) => throw new NotImplementedException();
- public override object? GetService(Type serviceType, object? serviceKey = null) => throw new NotImplementedException();
- public override IAsyncEnumerable> SearchAsync(TInput searchValue, int top, VectorSearchOptions? options = null, CancellationToken cancellationToken = default) => throw new NotImplementedException();
- public override Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) => throw new NotImplementedException();
- public override Task UpsertAsync(IEnumerable records, CancellationToken cancellationToken = default) => throw new NotImplementedException();
- }
-}
-
-public abstract class DependencyInjectionTests
-{
- public sealed class Record : TestRecord
- {
- [VectorStoreData(StorageName = "number")]
- public int Number { get; set; }
-
- [VectorStoreVector(Dimensions: 3, StorageName = "embedding")]
- public ReadOnlyMemory Floats { get; set; }
- }
-}
diff --git a/dotnet/test/VectorData/VectorData.ConformanceTests/DistanceFunctionTests.cs b/dotnet/test/VectorData/VectorData.ConformanceTests/DistanceFunctionTests.cs
deleted file mode 100644
index 182954d9d985..000000000000
--- a/dotnet/test/VectorData/VectorData.ConformanceTests/DistanceFunctionTests.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using Microsoft.Extensions.VectorData;
-using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
-using Xunit;
-
-namespace VectorData.ConformanceTests;
-
-public abstract class DistanceFunctionTests(DistanceFunctionTests.Fixture fixture)
- where TKey : notnull
-{
- [ConditionalFact]
- public virtual Task CosineDistance()
- => this.Test(DistanceFunction.CosineDistance, 0, 2, 1, [0, 2, 1]);
-
- [ConditionalFact]
- public virtual Task CosineSimilarity()
- => this.Test(DistanceFunction.CosineSimilarity, 1, -1, 0, [0, 2, 1]);
-
- [ConditionalFact]
- public virtual Task DotProductSimilarity()
- => this.Test(DistanceFunction.DotProductSimilarity, 1, -1, 0, [0, 2, 1]);
-
- [ConditionalFact]
- public virtual Task NegativeDotProductSimilarity()
- => this.Test(DistanceFunction.NegativeDotProductSimilarity, -1, 1, 0, [0, 2, 1]);
-
- [ConditionalFact]
- public virtual Task EuclideanDistance()
- => this.Test(DistanceFunction.EuclideanDistance, 0, 2, 1.73, [0, 2, 1]);
-
- [ConditionalFact]
- public virtual Task EuclideanSquaredDistance()
- => this.Test(DistanceFunction.EuclideanSquaredDistance, 0, 4, 3, [0, 2, 1]);
-
- [ConditionalFact]
- public virtual Task HammingDistance()
- => this.Test(DistanceFunction.HammingDistance, 0, 1, 3, [0, 1, 2]);
-
- [ConditionalFact]
- public virtual Task ManhattanDistance()
- => this.Test(DistanceFunction.ManhattanDistance, 0, 2, 3, [0, 1, 2]);
-
- protected virtual async Task Test(
- string distanceFunction,
- double expectedExactMatchScore,
- double expectedOppositeScore,
- double expectedOrthogonalScore,
- int[] resultOrder)
- {
- using var collection = fixture.CreateCollection(distanceFunction);
- await collection.EnsureCollectionDeletedAsync();
- await collection.EnsureCollectionExistsAsync();
-
- ReadOnlyMemory baseVector = new([1, 0, 0, 0]);
- ReadOnlyMemory oppositeVector = new([-1, 0, 0, 0]);
- ReadOnlyMemory orthogonalVector = new([0f, -1f, -1f, 0f]);
-
- double[] scoreDictionary =
- [
- expectedExactMatchScore,
- expectedOppositeScore,
- expectedOrthogonalScore
- ];
-
- double[] expectedScores =
- [
- scoreDictionary[resultOrder[0]],
- scoreDictionary[resultOrder[1]],
- scoreDictionary[resultOrder[2]]
- ];
-
- List insertedRecords =
- [
- new()
- {
- Key = fixture.GenerateNextKey(),
- Int = 1,
- Vector = baseVector,
- },
- new()
- {
- Key = fixture.GenerateNextKey(),
- Int = 2,
- Vector = oppositeVector,
- },
- new()
- {
- Key = fixture.GenerateNextKey(),
- Int = 3,
- Vector = orthogonalVector,
- }
- ];
- SearchRecord[] expectedRecords =
- [
- insertedRecords[resultOrder[0]],
- insertedRecords[resultOrder[1]],
- insertedRecords[resultOrder[2]]
- ];
-
- await collection.UpsertAsync(insertedRecords);
-
- await fixture.TestStore.WaitForDataAsync(collection, insertedRecords.Count, vectorSize: 4);
-
- var results = await collection.SearchAsync(baseVector, top: 3).ToListAsync();
-
- Assert.Equal(expectedRecords.Length, results.Count);
- for (int i = 0; i < results.Count; i++)
- {
- Assert.Equal(expectedRecords[i].Key, results[i].Record.Key);
- Assert.Equal(expectedRecords[i].Int, results[i].Record.Int);
- if (fixture.AssertScores)
- {
- Assert.Equal(Math.Round(expectedScores[i], 2), Math.Round(results[i].Score!.Value, 2));
- }
- }
-
- await this.TestScoreThreshold(collection);
- }
-
- protected virtual async Task TestScoreThreshold(VectorStoreCollection collection)
- {
- if (!fixture.TestStore.SupportsScoreThreshold)
- {
- await Assert.ThrowsAsync(async () =>
- {
- await collection
- .SearchAsync(
- new ReadOnlyMemory([1, 0, 0, 0]),
- top: 3,
- new() { ScoreThreshold = 0.9 })
- .ToListAsync();
- });
-
- return;
- }
-
- // Fetch the top three records, then use the second's returned score as the threshold.
- var results = await collection
- .SearchAsync(new ReadOnlyMemory([1, 0, 0, 0]), top: 3)
- .ToListAsync();
-
- var threshold = results[1].Score;
-
- var filteredResults = await collection
- .SearchAsync(
- new ReadOnlyMemory([1, 0, 0, 0]),
- top: 3,
- new() { ScoreThreshold = threshold })
- .ToListAsync();
-
- // Some providers use inclusive thresholds (>=), returning 2 results (first and second),
- // while others use exclusive thresholds (>), returning only 1 result (first).
- Assert.True(filteredResults.Count is 1 or 2);
- Assert.Equal(results[0].Record.Key, filteredResults[0].Record.Key);
- if (filteredResults.Count == 2)
- {
- Assert.Equal(results[1].Record.Key, filteredResults[1].Record.Key);
- }
- }
-
- public abstract class Fixture : VectorStoreFixture
- {
- protected virtual string CollectionNameBase => nameof(DistanceFunctionTests);
- public virtual string CollectionName => this.TestStore.AdjustCollectionName(this.CollectionNameBase);
-
- protected virtual string? IndexKind => null;
-
- public virtual bool AssertScores { get; } = true;
-
- public virtual VectorStoreCollection CreateCollection(string distanceFunction)
- {
- VectorStoreCollectionDefinition definition = new()
- {
- Properties =
- [
- new VectorStoreKeyProperty(nameof(SearchRecord.Key), typeof(TKey)),
- new VectorStoreDataProperty(nameof(SearchRecord.Int), typeof(int)),
- new VectorStoreVectorProperty(nameof(SearchRecord.Vector), typeof(ReadOnlyMemory), dimensions: 4)
- {
- DistanceFunction = distanceFunction,
- IndexKind = this.IndexKind ?? this.DefaultIndexKind
- }
- ]
- };
-
- return this.TestStore.CreateCollection(this.CollectionName, definition);
- }
- }
-
- public class SearchRecord
- {
- public TKey Key { get; set; } = default!;
- public int Int { get; set; }
- public ReadOnlyMemory Vector { get; set; }
- }
-}
diff --git a/dotnet/test/VectorData/VectorData.ConformanceTests/EmbeddingGenerationTests.cs b/dotnet/test/VectorData/VectorData.ConformanceTests/EmbeddingGenerationTests.cs
deleted file mode 100644
index c3b13dc8fde5..000000000000
--- a/dotnet/test/VectorData/VectorData.ConformanceTests/EmbeddingGenerationTests.cs
+++ /dev/null
@@ -1,623 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using Microsoft.Extensions.AI;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.VectorData;
-using VectorData.ConformanceTests.Support;
-using VectorData.ConformanceTests.Xunit;
-using Xunit;
-
-namespace VectorData.ConformanceTests;
-
-#pragma warning disable CA2000 // Don't actually need to dispose FakeEmbeddingGenerator
-#pragma warning disable CS8605 // Unboxing a possibly null value.
-
-public abstract class EmbeddingGenerationTests(EmbeddingGenerationTests.StringVectorFixture stringVectorFixture, EmbeddingGenerationTests.RomOfFloatVectorFixture romOfFloatVectorFixture)
- where TKey : notnull
-{
- #region Search
-
- [ConditionalFact]
- public virtual async Task SearchAsync_with_property_generator()
- {
- // Property level: embedding generators are defined at all levels. The property generator should take precedence.
- var collection = this.GetCollection(storeGenerator: true, collectionGenerator: true, propertyGenerator: true);
-
- var result = await collection.SearchAsync("[1, 1, 0]", top: 1).SingleAsync();
-
- Assert.Equal("Property ([1, 1, 3])", result.Record.Text);
- }
-
- [ConditionalFact]
- public virtual async Task SearchAsync_with_property_generator_dynamic()
- {
- // Property level: embedding generators are defined at all levels. The property generator should take precedence.
- var collection = this.GetDynamicCollection(storeGenerator: true, collectionGenerator: true, propertyGenerator: true);
-
- var result = await collection.SearchAsync("[1, 1, 0]", top: 1).SingleAsync();
-
- Assert.Equal("Property ([1, 1, 3])", result.Record[nameof(Record.Text)]);
- }
-
- [ConditionalFact]
- public virtual async Task SearchAsync_with_collection_generator()
- {
- // Collection level: embedding generators are defined at the collection and store level - the collection generator should take precedence.
- var collection = this.GetCollection(storeGenerator: true, collectionGenerator: true, propertyGenerator: false);
-
- var result = await collection.SearchAsync("[1, 1, 0]", top: 1).SingleAsync();
-
- Assert.Equal("Collection ([1, 1, 2])", result.Record.Text);
- }
-
- [ConditionalFact]
- public virtual async Task SearchAsync_with_store_generator()
- {
- // Store level: an embedding generator is defined at the store level only.
- var collection = this.GetCollection(storeGenerator: true, collectionGenerator: false, propertyGenerator: false);
-
- var result = await collection.SearchAsync("[1, 1, 0]", top: 1).SingleAsync();
-
- Assert.Equal("Store ([1, 1, 1])", result.Record.Text);
- }
-
- [ConditionalFact]
- public virtual async Task SearchAsync_with_store_dependency_injection()
- {
- foreach (var registrationDelegate in stringVectorFixture.DependencyInjectionStoreRegistrationDelegates)
- {
- IServiceCollection serviceCollection = new ServiceCollection();
-
- serviceCollection.AddSingleton(new FakeEmbeddingGenerator(replaceLast: 1));
- registrationDelegate(serviceCollection);
-
- await using var serviceProvider = serviceCollection.BuildServiceProvider();
-
- var vectorStore = serviceProvider.GetRequiredService();
- var collection = vectorStore.GetCollection(stringVectorFixture.CollectionName, stringVectorFixture.CreateRecordDefinition());
-
- var result = await collection.SearchAsync("[1, 1, 0]", top: 1).SingleAsync();
-
- Assert.Equal("Store ([1, 1, 1])", result.Record.Text);
- }
- }
-
- [ConditionalFact]
- public virtual async Task SearchAsync_with_collection_dependency_injection()
- {
- foreach (var registrationDelegate in stringVectorFixture.DependencyInjectionCollectionRegistrationDelegates)
- {
- IServiceCollection serviceCollection = new ServiceCollection();
-
- serviceCollection.AddSingleton(new FakeEmbeddingGenerator(replaceLast: 1));
- registrationDelegate(serviceCollection);
-
- await using var serviceProvider = serviceCollection.BuildServiceProvider();
-
- var collection = serviceProvider.GetRequiredService>();
-
- var result = await collection.SearchAsync("[1, 1, 0]", top: 1).SingleAsync();
-
- Assert.Equal("Store ([1, 1, 1])", result.Record.Text);
- }
- }
-
- [ConditionalFact]
- public virtual async Task SearchAsync_with_custom_input_type()
- {
- var recordDefinition = new VectorStoreCollectionDefinition()
- {
- Properties = stringVectorFixture.CreateRecordDefinition().Properties
- .Select(p => p is VectorStoreVectorProperty vectorProperty
- ? new VectorStoreVectorProperty