Files
microsoft--semantic-kernel/dotnet/test/VectorData/Redis.ConformanceTests/ModelTests/RedisHashSetNoDataModelTests.cs
T
wehub-resource-sync b957a53def
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:21:23 +08:00

35 lines
1.1 KiB
C#

// Copyright (c) Microsoft. All rights reserved.
using Redis.ConformanceTests.Support;
using VectorData.ConformanceTests.ModelTests;
using VectorData.ConformanceTests.Support;
using Xunit;
namespace Redis.ConformanceTests.ModelTests;
public class RedisHashSetNoDataModelTests(RedisHashSetNoDataModelTests.Fixture fixture)
: NoDataModelTests<string>(fixture), IClassFixture<RedisHashSetNoDataModelTests.Fixture>
{
public override async Task GetAsync_single_record(bool includeVectors)
{
var expectedRecord = fixture.TestData[0];
var received = await this.Collection.GetAsync(expectedRecord.Key, new() { IncludeVectors = includeVectors });
if (includeVectors)
{
expectedRecord.AssertEqual(received, includeVectors, fixture.TestStore.VectorsComparable);
}
else
{
// When vectors aren't included and there's no other data, we get null back.
Assert.Null(received);
}
}
public new class Fixture : NoDataModelTests<string>.Fixture
{
public override TestStore TestStore => RedisTestStore.HashSetInstance;
}
}