From ab649219b43254252cc348e245709d17ef835ebd Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Wed, 4 Mar 2026 22:37:55 +0100 Subject: [PATCH] Fix tests --- .../Infrastructure/Queries/EFQueryTests.cs | 14 +++++++------- .../EntityFramework/TestHelpers/TestEntity.cs | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/backend/tests/Squidex.Data.Tests/EntityFramework/Infrastructure/Queries/EFQueryTests.cs b/backend/tests/Squidex.Data.Tests/EntityFramework/Infrastructure/Queries/EFQueryTests.cs index 17a906c28..1f5daa2de 100644 --- a/backend/tests/Squidex.Data.Tests/EntityFramework/Infrastructure/Queries/EFQueryTests.cs +++ b/backend/tests/Squidex.Data.Tests/EntityFramework/Infrastructure/Queries/EFQueryTests.cs @@ -34,8 +34,8 @@ public abstract class EFQueryTests(ISqlFixture fixture) { var dbContext = await CreateDbContextAsync(); - await dbContext.CreateGeoIndexAsync("IDX_GEO", "TestEntity", "Point"); - await dbContext.CreateTextIndexAsync("IDX_Text", "TestEntity", "FullText"); + await dbContext.CreateGeoIndexAsync("IDX_GEO", nameof(TestEntity), "Point"); + await dbContext.CreateTextIndexAsync("IDX_Text", nameof(TestEntity), "FullText"); var set = dbContext.Set(); if (await set.AnyAsync()) @@ -61,7 +61,7 @@ public abstract class EFQueryTests(ISqlFixture fixture) mixed = true; break; case 4: - mixed = new List { i, true }; + mixed = new List { i }; break; default: mixed = new Dictionary(); @@ -499,7 +499,7 @@ public abstract class EFQueryTests(ISqlFixture fixture) var dbContext = await CreateAndPrepareDbContextAsync(); var builder = - new TestSqlBuilder(dbContext.Dialect, "TestEntity") + new TestSqlBuilder(dbContext.Dialect, nameof(TestEntity)) .Count(); var (sql, parameters) = builder.Compile(); @@ -525,7 +525,7 @@ public abstract class EFQueryTests(ISqlFixture fixture) var dbContext = await CreateAndPrepareDbContextAsync(); var queryBuilder = - new TestSqlBuilder(dbContext.Dialect, "TestEntity") + new TestSqlBuilder(dbContext.Dialect, nameof(TestEntity)) .WhereMatch("FullText", "hello"); var (sql, parameters) = queryBuilder.Compile(); @@ -540,7 +540,7 @@ public abstract class EFQueryTests(ISqlFixture fixture) var dbContext = await CreateAndPrepareDbContextAsync(); var queryBuilder = - new TestSqlBuilder(dbContext.Dialect, "TestEntity") + new TestSqlBuilder(dbContext.Dialect, nameof(TestEntity)) .WhereMatch("FullText", "hello world"); var (sql, parameters) = queryBuilder.Compile(); @@ -575,7 +575,7 @@ public abstract class EFQueryTests(ISqlFixture fixture) var dbContext = await CreateAndPrepareDbContextAsync(); var queryBuilder = - new TestSqlBuilder(dbContext.Dialect, "TestEntity") + new TestSqlBuilder(dbContext.Dialect, nameof(TestEntity)) .Limit(query) .Offset(query) .Order(query) diff --git a/backend/tests/Squidex.Data.Tests/EntityFramework/TestHelpers/TestEntity.cs b/backend/tests/Squidex.Data.Tests/EntityFramework/TestHelpers/TestEntity.cs index dcfb0d9c4..ef1e22bdd 100644 --- a/backend/tests/Squidex.Data.Tests/EntityFramework/TestHelpers/TestEntity.cs +++ b/backend/tests/Squidex.Data.Tests/EntityFramework/TestHelpers/TestEntity.cs @@ -6,6 +6,7 @@ // ========================================================================== using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; using NetTopologySuite.Geometries; #pragma warning disable MA0048 // File name must match type name