Path: redb/redb.Tests.Integration/Tests/Base/FreeAnyExistsTestsBase.cs
Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb
Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Tests.Integration/Tests/Base/FreeAnyExistsTestsBase.cs
----
using redb.Core;
using redb.Core.Models.Entities;
using redb.Core.Query;
using redb.Tests.Integration.Helpers;
using redb.Tests.Integration.Models;
namespace redb.Tests.Integration.Tests.Base;
///
/// Free AnyAsync runs the inner statement of the v2-pvt module under EXISTS, which stops at the first match; it used to
/// count every match. Every form gives the answer it gave, the count above zero.
///
public abstract class FreeAnyExistsTestsBase
{
protected readonly IRedbService Redb;
protected FreeAnyExistsTestsBase(IRedbService redb) => Redb = redb;
private async Task SeedEmployeesAsync()
{
await Redb.SyncSchemeAsync();
var tag = "any-" + Guid.NewGuid().ToString("N")[..8];
await Redb.SaveAsync(Enumerable.Range(0, 5)
.Select(i => TestDataFactory.CreateEmployee(i, salary: 100m * (i + 1), department: $"{tag}-D{i % 2}")).ToList());
return tag;
}
public static IEnumerable