From c8f9a048008ac14fb2d9afaac39451f803ba72d0 Mon Sep 17 00:00:00 2001 From: Serge K Date: Sun, 5 Jan 2025 21:41:36 +0700 Subject: [PATCH 1/3] upgrade to xunit v3 --- tests/Repositories.Base/Repositories.Base.csproj | 2 +- tests/SqlGenerator.Tests/SqlGenerator.Tests.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Repositories.Base/Repositories.Base.csproj b/tests/Repositories.Base/Repositories.Base.csproj index ae7d55e8..e3787687 100644 --- a/tests/Repositories.Base/Repositories.Base.csproj +++ b/tests/Repositories.Base/Repositories.Base.csproj @@ -6,7 +6,7 @@ - + diff --git a/tests/SqlGenerator.Tests/SqlGenerator.Tests.csproj b/tests/SqlGenerator.Tests/SqlGenerator.Tests.csproj index bc9cc6ab..730f0068 100644 --- a/tests/SqlGenerator.Tests/SqlGenerator.Tests.csproj +++ b/tests/SqlGenerator.Tests/SqlGenerator.Tests.csproj @@ -6,7 +6,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From c20cf25707d3aab53f01c73699218ef2e581ea74 Mon Sep 17 00:00:00 2001 From: Serge K Date: Sun, 5 Jan 2025 21:45:42 +0700 Subject: [PATCH 2/3] async void -> async Task --- tests/Repositories.Base/BaseRepositoriesTests.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/Repositories.Base/BaseRepositoriesTests.cs b/tests/Repositories.Base/BaseRepositoriesTests.cs index 0d6e4926..af0d86fb 100644 --- a/tests/Repositories.Base/BaseRepositoriesTests.cs +++ b/tests/Repositories.Base/BaseRepositoriesTests.cs @@ -97,7 +97,7 @@ public void FindById_MultiKeys() } [Fact] - public async void FindByIdAsync() + public async Task FindByIdAsync() { var user = await Db.Users.FindByIdAsync(2); Assert.Null(user.Deleted); @@ -105,7 +105,7 @@ public async void FindByIdAsync() } [Fact] - public async void FindByIdAsync_WithJoins_NotNull() + public async Task FindByIdAsync_WithJoins_NotNull() { var user = await Db.Users.FindByIdAsync(1, x => x.Cars, x => x.Phone, x => x.Addresses); Assert.Null(user.Deleted); @@ -117,7 +117,7 @@ public async void FindByIdAsync_WithJoins_NotNull() } [Fact] - public async void FindByIdAsync_WithJoins_CheckCount() + public async Task FindByIdAsync_WithJoins_CheckCount() { var address = await Db.Address.FindByIdAsync(1, x => x.Users); Assert.Equal("Street0", address.Street); @@ -126,7 +126,7 @@ public async void FindByIdAsync_WithJoins_CheckCount() } [Fact] - public async void FindAllAsync_WithPredicate_CheckCount() + public async Task FindAllAsync_WithPredicate_CheckCount() { var addresses = (await Db.Address.FindAllAsync(q => q.Id == 1, x => x.Users)).ToArray(); Assert.Single(addresses); @@ -137,7 +137,7 @@ public async void FindAllAsync_WithPredicate_CheckCount() } [Fact] - public async void FindAllAsync_NullPredicate_CheckCount() + public async Task FindAllAsync_NullPredicate_CheckCount() { var addresses = (await Db.Address.FindAllAsync(null, x => x.Users)).ToArray(); var address = addresses.First(); @@ -157,7 +157,7 @@ protected void FindJoin_CollectionnRecord() } [Fact] - public async void FindJoinAsync_CollectionnRecord() + public async Task FindJoinAsync_CollectionnRecord() { var user = await Db.Users.FindAsync(q => q.Id == 1, q => q.Cars); Assert.Null(user.Deleted); @@ -281,7 +281,7 @@ public void FindAllJoinSameTableTwice() } [Fact] - public async void FindAllJoinSameTableTwiceAsync() + public async Task FindAllJoinSameTableTwiceAsync() { var user = (await Db.Users.FindAllAsync(x => x.Id == 1, q => q.OfficePhone, q => q.Cars, q => q.Phone)).First(); Assert.True(user.Cars.Count == 2); From b7d00262a60b16f7af2cf18df45522e0ce0a75a9 Mon Sep 17 00:00:00 2001 From: Serge K Date: Sun, 5 Jan 2025 21:51:21 +0700 Subject: [PATCH 3/3] add xunit to each test project --- tests/Repositories.MSSQL.Tests/Repositories.MSSQL.Tests.csproj | 1 + tests/Repositories.MySql.Tests/Repositories.MySql.Tests.csproj | 1 + tests/Repositories.Oracle.Tests/Repositories.Oracle.Tests.csproj | 1 + .../Repositories.PostgreSQL.Tests.csproj | 1 + tests/Repositories.SQLite.Tests/Repositories.SQLite.Tests.csproj | 1 + 5 files changed, 5 insertions(+) diff --git a/tests/Repositories.MSSQL.Tests/Repositories.MSSQL.Tests.csproj b/tests/Repositories.MSSQL.Tests/Repositories.MSSQL.Tests.csproj index e0f1fb0f..61915f31 100644 --- a/tests/Repositories.MSSQL.Tests/Repositories.MSSQL.Tests.csproj +++ b/tests/Repositories.MSSQL.Tests/Repositories.MSSQL.Tests.csproj @@ -8,6 +8,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/Repositories.MySql.Tests/Repositories.MySql.Tests.csproj b/tests/Repositories.MySql.Tests/Repositories.MySql.Tests.csproj index 1bff6289..97ae0440 100644 --- a/tests/Repositories.MySql.Tests/Repositories.MySql.Tests.csproj +++ b/tests/Repositories.MySql.Tests/Repositories.MySql.Tests.csproj @@ -8,6 +8,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/Repositories.Oracle.Tests/Repositories.Oracle.Tests.csproj b/tests/Repositories.Oracle.Tests/Repositories.Oracle.Tests.csproj index b0ffbb7e..affd84d5 100644 --- a/tests/Repositories.Oracle.Tests/Repositories.Oracle.Tests.csproj +++ b/tests/Repositories.Oracle.Tests/Repositories.Oracle.Tests.csproj @@ -7,6 +7,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/Repositories.PostgreSQL.Tests/Repositories.PostgreSQL.Tests.csproj b/tests/Repositories.PostgreSQL.Tests/Repositories.PostgreSQL.Tests.csproj index 31149654..e61f5e04 100644 --- a/tests/Repositories.PostgreSQL.Tests/Repositories.PostgreSQL.Tests.csproj +++ b/tests/Repositories.PostgreSQL.Tests/Repositories.PostgreSQL.Tests.csproj @@ -7,6 +7,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/Repositories.SQLite.Tests/Repositories.SQLite.Tests.csproj b/tests/Repositories.SQLite.Tests/Repositories.SQLite.Tests.csproj index 25197b73..02d6faf6 100644 --- a/tests/Repositories.SQLite.Tests/Repositories.SQLite.Tests.csproj +++ b/tests/Repositories.SQLite.Tests/Repositories.SQLite.Tests.csproj @@ -8,6 +8,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive