1 write to Collection
Microsoft.Extensions.VectorData.ConformanceTests (1)
Support\VectorStoreCollectionFixtureBase.cs (1)
42
Collection
= GetCollection();
50 references to Collection
Microsoft.Extensions.VectorData.ConformanceTests (50)
FilterTests.cs (3)
36
string sqlInjection = $"foo; DROP TABLE {fixture.
Collection
.Name};";
512
var actual = await fixture.
Collection
.SearchAsync(
723
=> TestStore.WaitForDataAsync(
Collection
, recordCount: TestData.Count, r => r.Int > 0);
HybridSearchTests.cs (4)
160
=> (IKeywordHybridSearchable<VectorAndStringRecord<TKey>>)
Collection
;
206
=> TestStore.WaitForDataAsync(
Collection
, recordCount: TestData.Count, vectorSize: 4);
214
=> (IKeywordHybridSearchable<MultiTextStringRecord<TKey>>)
Collection
;
256
=> TestStore.WaitForDataAsync(
Collection
, recordCount: TestData.Count, vectorSize: 4);
ModelTests\BasicModelTests.cs (1)
463
protected VectorStoreCollection<TKey, Record> Collection => fixture.
Collection
;
ModelTests\DynamicModelTests.cs (19)
23
var received = await fixture.
Collection
.GetAsync(
37
var received = await fixture.
Collection
.GetAsync(ids, new() { IncludeVectors = includeVectors }).ToArrayAsync();
58
ArgumentNullException ex = await Assert.ThrowsAsync<ArgumentNullException>(() => fixture.
Collection
.GetAsync((TKey)default!));
65
ArgumentNullException ex = await Assert.ThrowsAsync<ArgumentNullException>(() => fixture.
Collection
.GetAsync(keys: null!).ToArrayAsync().AsTask());
74
Assert.Null(await fixture.
Collection
.GetAsync(key));
80
Assert.Empty(await fixture.
Collection
.GetAsync([]).ToArrayAsync());
89
var results = await fixture.
Collection
.GetAsync(
102
var count = await fixture.
Collection
.GetAsync(r => true, top: 100).CountAsync();
128
var results = await fixture.
Collection
.GetAsync(
137
results = await fixture.
Collection
.GetAsync(
167
var results = await fixture.
Collection
.GetAsync(
176
results = await fixture.
Collection
.GetAsync(
189
var results = await fixture.
Collection
.GetAsync(
291
Assert.NotNull(await fixture.
Collection
.GetAsync((TKey)recordToRemove[KeyPropertyName]!));
292
await fixture.
Collection
.DeleteAsync((TKey)recordToRemove[KeyPropertyName]!);
293
Assert.Null(await fixture.
Collection
.GetAsync((TKey)recordToRemove[KeyPropertyName]!));
301
await fixture.
Collection
.DeleteAsync(key);
303
Assert.Null(await fixture.
Collection
.GetAsync(key));
386
protected VectorStoreCollection<object, Dictionary<string, object?>> Collection => fixture.
Collection
;
ModelTests\MultiVectorModelTests.cs (2)
78
protected VectorStoreCollection<TKey, MultiVectorRecord> Collection => fixture.
Collection
;
125
=> TestStore.WaitForDataAsync(
Collection
, recordCount: TestData.Count, vectorProperty: r => r.Vector1);
ModelTests\NoDataModelTests.cs (1)
53
protected VectorStoreCollection<TKey, NoDataRecord> Collection => fixture.
Collection
;
ModelTests\NoVectorModelTests.cs (2)
54
protected VectorStoreCollection<TKey, NoVectorRecord> Collection => fixture.
Collection
;
89
var results = await
Collection
.GetAsync([TestData[0].Key, TestData[1].Key]).ToArrayAsync();
Support\DynamicVectorStoreCollectionFixture.cs (2)
21
await foreach (var record in
Collection
.GetAsync(r => true, top: BatchSize))
24
await
Collection
.DeleteAsync((TKey)record[KeyPropertyName]!);
Support\VectorStoreCollectionFixture.cs (2)
19
keys = await
Collection
.GetAsync(r => true, top: BatchSize).Select(r => r.Key).ToArrayAsync();
20
await
Collection
.DeleteAsync(keys);
Support\VectorStoreCollectionFixtureBase.cs (5)
44
if (await
Collection
.CollectionExistsAsync())
46
await
Collection
.EnsureCollectionDeletedAsync();
49
await
Collection
.EnsureCollectionExistsAsync();
61
await
Collection
.UpsertAsync(TestData);
67
=> TestStore.WaitForDataAsync(
Collection
, recordCount: TestData.Count);
TypeTests\DataTypeTests.cs (9)
171
await fixture.
Collection
.DeleteAsync([fixture.MainRecordKey, fixture.OtherRecordKey, fixture.NullRecordKey]);
172
await fixture.TestStore.WaitForDataAsync(fixture.
Collection
, recordCount: 0);
178
TRecord result = await fixture.
Collection
.GetAsync(fixture.MainRecordKey) ?? throw new InvalidOperationException($"Record with key '{fixture.MainRecordKey}' was not found.");
184
await TestFiltering(fixture.
Collection
, property, mainValue, comparisonAction, instantiationExpressionBody);
192
await fixture.
Collection
.EnsureCollectionDeletedAsync();
196
await fixture.
Collection
.DeleteAsync([fixture.MainRecordKey, fixture.OtherRecordKey, fixture.NullRecordKey]);
197
await fixture.TestStore.WaitForDataAsync(fixture.
Collection
, recordCount: 0);
264
await fixture.
Collection
.UpsertAsync(testData);
265
await fixture.TestStore.WaitForDataAsync(fixture.
Collection
, recordCount: testData.Count);