From 87beaa4aeb210ffe7c4cbc7fb8844f7199109441 Mon Sep 17 00:00:00 2001 From: rvergnory Date: Wed, 17 Jul 2024 16:23:33 +0200 Subject: [PATCH 1/2] Update : net6 -> net8 --- .github/workflows/dotnet.yml | 2 +- Directory.Build.props | 2 +- Rdd.sln | 6 +++ build.ps1 | 1 + global.json | 2 +- .../RDD.Web.AutoMapper.csproj | 8 ++-- src/Rdd.Application/Rdd.Application.csproj | 4 +- .../Exceptions/BadRequestException.cs | 5 --- .../Exceptions/BusinessException.cs | 12 ------ .../Exceptions/ForbiddenException.cs | 6 --- .../Exceptions/TechnicalException.cs | 12 ------ .../Exceptions/UnauthorizedException.cs | 6 --- .../UnsupportedContentTypeException.cs | 6 --- src/Rdd.Domain/Rdd.Domain.csproj | 8 ++-- .../Exceptions/QueryBuilderException.cs | 3 -- src/Rdd.Infra/Rdd.Infra.csproj | 6 +-- src/Rdd.Web/Rdd.Web.csproj | 12 +++--- .../Rdd.Z.EntityFramework.csproj | 6 +-- test/Rdd.Domain.Tests/AbstractEntityTests.cs | 5 ++- test/Rdd.Domain.Tests/ExceptionTests.cs | 39 ------------------- test/Rdd.Domain.Tests/Rdd.Domain.Tests.csproj | 14 +++---- .../Exceptions/ExceptionsTests.cs | 35 ----------------- test/Rdd.Infra.Tests/Rdd.Infra.Tests.csproj | 14 +++---- .../CollectionPropertiesTests.cs | 7 ++-- .../EfCoreMemoryLeakPrevention.cs | 6 ++- test/Rdd.Web.Tests/IntegrationTests.cs | 7 ++-- test/Rdd.Web.Tests/Rdd.Web.Tests.csproj | 18 ++++----- test/Rdd.Web.Tests/WebPagingTests.cs | 2 +- 28 files changed, 71 insertions(+), 183 deletions(-) delete mode 100644 test/Rdd.Domain.Tests/ExceptionTests.cs delete mode 100644 test/Rdd.Infra.Tests/Exceptions/ExceptionsTests.cs diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 5362741c..61c48e6c 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -18,7 +18,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: Install GitVersion uses: gittools/actions/gitversion/setup@v0.9.15 diff --git a/Directory.Build.props b/Directory.Build.props index 78e7163a..aba8747d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -29,7 +29,7 @@ - + \ No newline at end of file diff --git a/Rdd.sln b/Rdd.sln index d95ab03b..30276235 100644 --- a/Rdd.sln +++ b/Rdd.sln @@ -13,10 +13,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rdd.Application", "src\Rdd. EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{505AAC10-0297-43ED-8097-22B0CB65030B}" ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + .gitignore = .gitignore build.ps1 = build.ps1 + CODEOWNERS = CODEOWNERS + coverlet.runsettings = coverlet.runsettings Directory.Build.props = Directory.Build.props .github\workflows\dotnet.yml = .github\workflows\dotnet.yml + GitVersion.yml = GitVersion.yml global.json = global.json + README.md = README.md EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rdd.Domain.Tests", "test\Rdd.Domain.Tests\Rdd.Domain.Tests.csproj", "{CB42A78B-6DC8-4A20-B7EB-228FA1324C70}" diff --git a/build.ps1 b/build.ps1 index dc4c0389..8e135efd 100644 --- a/build.ps1 +++ b/build.ps1 @@ -17,4 +17,5 @@ param( dotnet pack .\Application\Rdd.Application\Rdd.Application.csproj --configuration Debug $propack -o $nuget_path dotnet pack .\Web\Rdd.Web\Rdd.Web.csproj --configuration Debug $propack -o $nuget_path dotnet pack .\Web\Rdd.Web.AutoMapper\RDD.Web.AutoMapper.csproj --configuration Debug $propack -o $nuget_path + dotnet pack .\Web\Rdd.Z.EntityFramework\Rdd.Z.EntityFramework.csproj --configuration Debug $propack -o $nuget_path \ No newline at end of file diff --git a/global.json b/global.json index 5a0ab4af..3fea262b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.0", + "version": "8.0.0", "rollForward": "latestFeature" } } diff --git a/src/RDD.Web.AutoMapper/RDD.Web.AutoMapper.csproj b/src/RDD.Web.AutoMapper/RDD.Web.AutoMapper.csproj index 1be2de8c..675c71e8 100644 --- a/src/RDD.Web.AutoMapper/RDD.Web.AutoMapper.csproj +++ b/src/RDD.Web.AutoMapper/RDD.Web.AutoMapper.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 @@ -13,11 +13,11 @@ - - + + - + diff --git a/src/Rdd.Application/Rdd.Application.csproj b/src/Rdd.Application/Rdd.Application.csproj index d30d360c..f64b9691 100644 --- a/src/Rdd.Application/Rdd.Application.csproj +++ b/src/Rdd.Application/Rdd.Application.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 {C07BD97E-A1DC-47FB-9C00-23B6B3CB70B8} @@ -10,7 +10,7 @@ - + diff --git a/src/Rdd.Domain/Exceptions/BadRequestException.cs b/src/Rdd.Domain/Exceptions/BadRequestException.cs index a2915082..c3e2cf3c 100644 --- a/src/Rdd.Domain/Exceptions/BadRequestException.cs +++ b/src/Rdd.Domain/Exceptions/BadRequestException.cs @@ -17,11 +17,6 @@ public BadRequestException(string message, Exception innerException) { } - protected BadRequestException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - public override HttpStatusCode StatusCode => HttpStatusCode.BadRequest; } } diff --git a/src/Rdd.Domain/Exceptions/BusinessException.cs b/src/Rdd.Domain/Exceptions/BusinessException.cs index a1f6456f..86d29f7a 100644 --- a/src/Rdd.Domain/Exceptions/BusinessException.cs +++ b/src/Rdd.Domain/Exceptions/BusinessException.cs @@ -1,6 +1,5 @@ using System; using System.Net; -using System.Runtime.Serialization; namespace Rdd.Domain.Exceptions { @@ -20,17 +19,6 @@ protected BusinessException(string message, Exception innerException) { } - protected BusinessException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - public abstract HttpStatusCode StatusCode { get; } - - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - base.GetObjectData(info, context); - info.AddValue(nameof(StatusCode), StatusCode); - } } } \ No newline at end of file diff --git a/src/Rdd.Domain/Exceptions/ForbiddenException.cs b/src/Rdd.Domain/Exceptions/ForbiddenException.cs index e6cb6281..d150a8d2 100644 --- a/src/Rdd.Domain/Exceptions/ForbiddenException.cs +++ b/src/Rdd.Domain/Exceptions/ForbiddenException.cs @@ -1,6 +1,5 @@ using System; using System.Net; -using System.Runtime.Serialization; namespace Rdd.Domain.Exceptions { @@ -12,11 +11,6 @@ public ForbiddenException(string message) { } - private ForbiddenException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - public override HttpStatusCode StatusCode => HttpStatusCode.Forbidden; } } \ No newline at end of file diff --git a/src/Rdd.Domain/Exceptions/TechnicalException.cs b/src/Rdd.Domain/Exceptions/TechnicalException.cs index 9f64ce51..2d62f225 100644 --- a/src/Rdd.Domain/Exceptions/TechnicalException.cs +++ b/src/Rdd.Domain/Exceptions/TechnicalException.cs @@ -1,6 +1,5 @@ using System; using System.Net; -using System.Runtime.Serialization; namespace Rdd.Domain.Exceptions { @@ -21,17 +20,6 @@ public TechnicalException(string message, Exception innerException) { } - private TechnicalException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - public HttpStatusCode StatusCode => HttpStatusCode.InternalServerError; - - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - base.GetObjectData(info, context); - info.AddValue(nameof(StatusCode), StatusCode); - } } } \ No newline at end of file diff --git a/src/Rdd.Domain/Exceptions/UnauthorizedException.cs b/src/Rdd.Domain/Exceptions/UnauthorizedException.cs index 6f255b29..dcb5aa74 100644 --- a/src/Rdd.Domain/Exceptions/UnauthorizedException.cs +++ b/src/Rdd.Domain/Exceptions/UnauthorizedException.cs @@ -1,6 +1,5 @@ using System; using System.Net; -using System.Runtime.Serialization; namespace Rdd.Domain.Exceptions { @@ -12,11 +11,6 @@ public UnauthorizedException(string message) { } - private UnauthorizedException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - public override HttpStatusCode StatusCode => HttpStatusCode.Unauthorized; } } \ No newline at end of file diff --git a/src/Rdd.Domain/Exceptions/UnsupportedContentTypeException.cs b/src/Rdd.Domain/Exceptions/UnsupportedContentTypeException.cs index 397d287a..e3513b12 100644 --- a/src/Rdd.Domain/Exceptions/UnsupportedContentTypeException.cs +++ b/src/Rdd.Domain/Exceptions/UnsupportedContentTypeException.cs @@ -1,6 +1,5 @@ using System; using System.Net; -using System.Runtime.Serialization; namespace Rdd.Domain.Exceptions { @@ -12,11 +11,6 @@ public UnsupportedContentTypeException(string message) { } - private UnsupportedContentTypeException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - public override HttpStatusCode StatusCode => HttpStatusCode.UnsupportedMediaType; } } \ No newline at end of file diff --git a/src/Rdd.Domain/Rdd.Domain.csproj b/src/Rdd.Domain/Rdd.Domain.csproj index 9bdba9ca..5849297f 100644 --- a/src/Rdd.Domain/Rdd.Domain.csproj +++ b/src/Rdd.Domain/Rdd.Domain.csproj @@ -1,18 +1,18 @@  - net6.0 + net8.0 {64D838DB-55D3-4F2E-8EDB-CF1866B3939B} - - + + - + diff --git a/src/Rdd.Infra/Exceptions/QueryBuilderException.cs b/src/Rdd.Infra/Exceptions/QueryBuilderException.cs index 1e345b65..650cee10 100644 --- a/src/Rdd.Infra/Exceptions/QueryBuilderException.cs +++ b/src/Rdd.Infra/Exceptions/QueryBuilderException.cs @@ -1,7 +1,6 @@ using Rdd.Domain.Exceptions; using System; using System.Net; -using System.Runtime.Serialization; namespace Rdd.Infra.Exceptions { @@ -12,7 +11,5 @@ public sealed class QueryBuilderException : BusinessException public QueryBuilderException(string message) : base(message) { } public QueryBuilderException(string message, Exception innerException) : base(message, innerException) { } - - private QueryBuilderException(SerializationInfo info, StreamingContext context) : base(info, context) { } } } \ No newline at end of file diff --git a/src/Rdd.Infra/Rdd.Infra.csproj b/src/Rdd.Infra/Rdd.Infra.csproj index 5605d27d..61a386a0 100644 --- a/src/Rdd.Infra/Rdd.Infra.csproj +++ b/src/Rdd.Infra/Rdd.Infra.csproj @@ -1,12 +1,12 @@  - net6.0 + net8.0 {ED772E81-78BC-4126-8A4F-CB6EAFA72A4D} - + @@ -14,7 +14,7 @@ - + diff --git a/src/Rdd.Web/Rdd.Web.csproj b/src/Rdd.Web/Rdd.Web.csproj index 832482af..36ddbfbb 100644 --- a/src/Rdd.Web/Rdd.Web.csproj +++ b/src/Rdd.Web/Rdd.Web.csproj @@ -1,15 +1,15 @@  - net6.0 + net8.0 {35EB26DD-BF14-4B20-A644-9E566F51EA76} - - - - + + + + @@ -19,6 +19,6 @@ - + diff --git a/src/Rdd.Z.EntityFramework/Rdd.Z.EntityFramework.csproj b/src/Rdd.Z.EntityFramework/Rdd.Z.EntityFramework.csproj index c63bfbff..9ac9b57a 100644 --- a/src/Rdd.Z.EntityFramework/Rdd.Z.EntityFramework.csproj +++ b/src/Rdd.Z.EntityFramework/Rdd.Z.EntityFramework.csproj @@ -1,11 +1,11 @@  - net6.0 + net8.0 - + @@ -14,7 +14,7 @@ - + diff --git a/test/Rdd.Domain.Tests/AbstractEntityTests.cs b/test/Rdd.Domain.Tests/AbstractEntityTests.cs index 6041a348..f9c7684d 100644 --- a/test/Rdd.Domain.Tests/AbstractEntityTests.cs +++ b/test/Rdd.Domain.Tests/AbstractEntityTests.cs @@ -4,6 +4,7 @@ using Rdd.Domain.Tests.Models; using Rdd.Infra.Storage; using System.Linq; +using System.Threading.Tasks; using Xunit; namespace Rdd.Domain.Tests @@ -23,7 +24,7 @@ public ConcreteClassThreeCollection(IRepository repository) public class AbstractEntityTests { [Fact] - public async void NonAbstractCollection_SHOULD_return_all_entities_WHEN_GetAll_is_called() + public async Task NonAbstractCollection_SHOULD_return_all_entities_WHEN_GetAll_is_called() { var rightsService = new OpenRightExpressionsHelper(); var storage = new InMemoryStorageService(); @@ -40,7 +41,7 @@ public async void NonAbstractCollection_SHOULD_return_all_entities_WHEN_GetAll_i } [Fact] - public async void AbstractCollection_SHOULD_return_all_entities_WHEN_GetAll_is_called() + public async Task AbstractCollection_SHOULD_return_all_entities_WHEN_GetAll_is_called() { var rightsService = new OpenRightExpressionsHelper(); var storage = new InMemoryStorageService(); diff --git a/test/Rdd.Domain.Tests/ExceptionTests.cs b/test/Rdd.Domain.Tests/ExceptionTests.cs deleted file mode 100644 index ef95bcc3..00000000 --- a/test/Rdd.Domain.Tests/ExceptionTests.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Rdd.Domain.Exceptions; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Net; -using System.Runtime.Serialization; -using Xunit; - -namespace Rdd.Domain.Tests -{ - public class ExceptionTests - { - public class ExceptionData : IEnumerable - { - public IEnumerator GetEnumerator() - { - yield return new object[] { new BadRequestException("lol") }; - yield return new object[] { new BadRequestException("lol", new Exception("")) }; - yield return new object[] { new ForbiddenException("lol") }; - yield return new object[] { new TechnicalException("lol") }; - yield return new object[] { new TechnicalException("lol", new Exception("")) }; - yield return new object[] { new UnauthorizedException("lol") }; - yield return new object[] { new UnsupportedContentTypeException("lol") }; - } - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - } - - [Theory] - [ClassData(typeof(ExceptionData))] - public void Exception(T exception) where T : Exception, IStatusCodeException - { - var info = new SerializationInfo(exception.GetType(), new FormatterConverter()); - exception.GetObjectData(info, new StreamingContext(StreamingContextStates.All)); - - Assert.Equal(exception.StatusCode, info.GetValue(nameof(BusinessException.StatusCode), typeof(HttpStatusCode))); - } - } -} \ No newline at end of file diff --git a/test/Rdd.Domain.Tests/Rdd.Domain.Tests.csproj b/test/Rdd.Domain.Tests/Rdd.Domain.Tests.csproj index 8138b4aa..34751942 100644 --- a/test/Rdd.Domain.Tests/Rdd.Domain.Tests.csproj +++ b/test/Rdd.Domain.Tests/Rdd.Domain.Tests.csproj @@ -1,21 +1,21 @@  - net6.0 + net8.0 {CB42A78B-6DC8-4A20-B7EB-228FA1324C70} true - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - - + + all runtime; build; native; contentfiles; analyzers @@ -29,7 +29,7 @@ - + diff --git a/test/Rdd.Infra.Tests/Exceptions/ExceptionsTests.cs b/test/Rdd.Infra.Tests/Exceptions/ExceptionsTests.cs deleted file mode 100644 index e07c42f2..00000000 --- a/test/Rdd.Infra.Tests/Exceptions/ExceptionsTests.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Rdd.Domain.Exceptions; -using Rdd.Infra.Exceptions; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Net; -using System.Runtime.Serialization; -using Xunit; - -namespace Rdd.Infra.Tests.Exceptions -{ - public class ExceptionsTests - { - public class ExceptionData : IEnumerable - { - public IEnumerator GetEnumerator() - { - yield return new object[] { new QueryBuilderException("lol") }; - yield return new object[] { new QueryBuilderException("lol", new Exception("")) }; - } - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - } - - [Theory] - [ClassData(typeof(ExceptionData))] - public void Exception(T exception) where T : Exception, IStatusCodeException - { - var info = new SerializationInfo(exception.GetType(), new FormatterConverter()); - exception.GetObjectData(info, new StreamingContext(StreamingContextStates.All)); - - Assert.Equal(exception.StatusCode, info.GetValue(nameof(BusinessException.StatusCode), typeof(HttpStatusCode))); - } - } -} diff --git a/test/Rdd.Infra.Tests/Rdd.Infra.Tests.csproj b/test/Rdd.Infra.Tests/Rdd.Infra.Tests.csproj index 1b29bea2..631d5aae 100644 --- a/test/Rdd.Infra.Tests/Rdd.Infra.Tests.csproj +++ b/test/Rdd.Infra.Tests/Rdd.Infra.Tests.csproj @@ -1,24 +1,24 @@  - net6.0 + net8.0 {F57353AE-696A-4941-B7B6-780A32445898} true - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + all runtime; build; native; contentfiles; analyzers - + @@ -27,7 +27,7 @@ - + diff --git a/test/Rdd.Web.Tests/CollectionPropertiesTests.cs b/test/Rdd.Web.Tests/CollectionPropertiesTests.cs index 0cb0857e..4d79e483 100644 --- a/test/Rdd.Web.Tests/CollectionPropertiesTests.cs +++ b/test/Rdd.Web.Tests/CollectionPropertiesTests.cs @@ -4,6 +4,7 @@ using System.Linq; using Rdd.Domain.Models.Querying; using Xunit; +using System.Threading.Tasks; namespace Rdd.Web.Tests { @@ -23,7 +24,7 @@ public CollectionPropertiesTests(DefaultFixture fixture) } [Fact] - public async void Count_of_collection_should_tell_10_when_10_entities() + public async Task Count_of_collection_should_tell_10_when_10_entities() { var users = User.GetManyRandomUsers(10); await _repo.AddRangeAsync(users, new Query { Verb = Domain.Helpers.HttpVerbs.Post }); @@ -33,7 +34,7 @@ public async void Count_of_collection_should_tell_10_when_10_entities() } [Fact] - public async void Count_of_collection_should_tell_100_when_100_entities() + public async Task Count_of_collection_should_tell_100_when_100_entities() { var users = User.GetManyRandomUsers(100); await _repo.AddRangeAsync(users, new Query { Verb = Domain.Helpers.HttpVerbs.Post }); @@ -43,7 +44,7 @@ public async void Count_of_collection_should_tell_100_when_100_entities() } [Fact] - public async void Count_of_collection_should_tell_10000_when_10000_entities() + public async Task Count_of_collection_should_tell_10000_when_10000_entities() { var users = User.GetManyRandomUsers(10000); await _repo.AddRangeAsync(users, new Query { Verb = Domain.Helpers.HttpVerbs.Post }); diff --git a/test/Rdd.Web.Tests/EfCoreMemoryLeakPrevention.cs b/test/Rdd.Web.Tests/EfCoreMemoryLeakPrevention.cs index 3e1897f5..6b4863e2 100644 --- a/test/Rdd.Web.Tests/EfCoreMemoryLeakPrevention.cs +++ b/test/Rdd.Web.Tests/EfCoreMemoryLeakPrevention.cs @@ -55,8 +55,10 @@ public async Task GenerateMultipleQueries() int cachedQueryCount = 0; - var entriesProperty = typeof(MemoryCache).GetProperty("EntriesCollection", BindingFlags.NonPublic | BindingFlags.Instance); - var entries = entriesProperty.GetValue(cache) as ICollection;// as ConcurrentDictionary; + var coherentStateProperty = typeof(MemoryCache).GetField("_coherentState", BindingFlags.NonPublic | BindingFlags.Instance); + var state = coherentStateProperty.GetValue(cache); + var entriesProperty = coherentStateProperty.FieldType.GetField("_entries", BindingFlags.NonPublic | BindingFlags.Instance); + var entries = entriesProperty.GetValue(state) as ICollection;// as ConcurrentDictionary; var items = new List(); if (entries != null) { diff --git a/test/Rdd.Web.Tests/IntegrationTests.cs b/test/Rdd.Web.Tests/IntegrationTests.cs index 0874bff4..9e8de268 100644 --- a/test/Rdd.Web.Tests/IntegrationTests.cs +++ b/test/Rdd.Web.Tests/IntegrationTests.cs @@ -8,6 +8,7 @@ using Rdd.Infra.Storage; using Rdd.Infra.Tests; using System.Linq; +using System.Threading.Tasks; using Xunit; namespace Rdd.Web.Tests @@ -23,7 +24,7 @@ public IntegrationTests(DefaultFixture fixture) //ce test vérifie que la manière dont est convertie les filtres sur les mailsaddress fonctionne jusque dans EF [Fact] - public async void MailAdressFiltersShouldWork() + public async Task MailAdressFiltersShouldWork() { await RunCodeInsideIsolatedDatabaseAsync(async (context) => { @@ -51,7 +52,7 @@ await RunCodeInsideIsolatedDatabaseAsync(async (context) => [InlineData(nameof(Parent.OptionalChild) + "." + nameof(OptionalChild.Name), "notequal,null")] [InlineData(nameof(Parent.OptionalChild) + "." + nameof(OptionalChild.Name), "null")] [InlineData(nameof(Parent.OptionalChild) + "." + nameof(OptionalChild.Name), "value")] - public async void LeftJoinShouldWork(string key, string value) + public async Task LeftJoinShouldWork(string key, string value) { await RunCodeInsideIsolatedDatabaseAsync(async (context) => { @@ -82,7 +83,7 @@ await RunCodeInsideIsolatedDatabaseAsync(async (context) => [InlineData("", false)] [InlineData("ab", false)] [InlineData("aedzbffc", false)] - public async void LikeOperatorShouldWork(string name, bool hasAny) + public async Task LikeOperatorShouldWork(string name, bool hasAny) { await RunCodeInsideIsolatedDatabaseAsync(async (context) => { diff --git a/test/Rdd.Web.Tests/Rdd.Web.Tests.csproj b/test/Rdd.Web.Tests/Rdd.Web.Tests.csproj index 03e8a70b..2e28ec90 100644 --- a/test/Rdd.Web.Tests/Rdd.Web.Tests.csproj +++ b/test/Rdd.Web.Tests/Rdd.Web.Tests.csproj @@ -1,23 +1,23 @@  - net6.0 + net8.0 {D4493283-1C57-48C9-BA9D-4C7862A40424} true - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - - + + all runtime; build; native; contentfiles; analyzers @@ -32,7 +32,7 @@ - + diff --git a/test/Rdd.Web.Tests/WebPagingTests.cs b/test/Rdd.Web.Tests/WebPagingTests.cs index b2f5a194..9bbc5012 100644 --- a/test/Rdd.Web.Tests/WebPagingTests.cs +++ b/test/Rdd.Web.Tests/WebPagingTests.cs @@ -27,7 +27,7 @@ public WebPaginggTests(DefaultFixture fixture) } [Fact] - public async void Default_Paging_should_be_0_to_10() + public async Task Default_Paging_should_be_0_to_10() { IEnumerable users = User.GetManyRandomUsers(20); await _repo.AddRangeAsync(users, new Query { Verb = Domain.Helpers.HttpVerbs.Post }); From 3b0dcf8a2f0f2810f74ff1cc4fb5c3234cdaebbc Mon Sep 17 00:00:00 2001 From: rvergnory Date: Fri, 25 Oct 2024 09:55:49 +0200 Subject: [PATCH 2/2] FIX :test + update nugets --- src/RDD.Web.AutoMapper/RDD.Web.AutoMapper.csproj | 2 +- src/Rdd.Domain/Rdd.Domain.csproj | 2 +- src/Rdd.Infra/Rdd.Infra.csproj | 2 +- src/Rdd.Web/Rdd.Web.csproj | 6 +++--- src/Rdd.Z.EntityFramework/Rdd.Z.EntityFramework.csproj | 2 +- test/Rdd.Domain.Tests/Rdd.Domain.Tests.csproj | 8 ++++---- test/Rdd.Infra.Tests/Rdd.Infra.Tests.csproj | 8 ++++---- test/Rdd.Web.Tests/EfCoreMemoryLeakPrevention.cs | 9 +++------ test/Rdd.Web.Tests/Rdd.Web.Tests.csproj | 10 +++++----- 9 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/RDD.Web.AutoMapper/RDD.Web.AutoMapper.csproj b/src/RDD.Web.AutoMapper/RDD.Web.AutoMapper.csproj index 675c71e8..8914afa1 100644 --- a/src/RDD.Web.AutoMapper/RDD.Web.AutoMapper.csproj +++ b/src/RDD.Web.AutoMapper/RDD.Web.AutoMapper.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/Rdd.Domain/Rdd.Domain.csproj b/src/Rdd.Domain/Rdd.Domain.csproj index 5849297f..525695f3 100644 --- a/src/Rdd.Domain/Rdd.Domain.csproj +++ b/src/Rdd.Domain/Rdd.Domain.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/Rdd.Infra/Rdd.Infra.csproj b/src/Rdd.Infra/Rdd.Infra.csproj index 61a386a0..49e58996 100644 --- a/src/Rdd.Infra/Rdd.Infra.csproj +++ b/src/Rdd.Infra/Rdd.Infra.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/Rdd.Web/Rdd.Web.csproj b/src/Rdd.Web/Rdd.Web.csproj index 36ddbfbb..89713c6e 100644 --- a/src/Rdd.Web/Rdd.Web.csproj +++ b/src/Rdd.Web/Rdd.Web.csproj @@ -7,9 +7,9 @@ - - - + + + diff --git a/src/Rdd.Z.EntityFramework/Rdd.Z.EntityFramework.csproj b/src/Rdd.Z.EntityFramework/Rdd.Z.EntityFramework.csproj index 9ac9b57a..e4e9f7b3 100644 --- a/src/Rdd.Z.EntityFramework/Rdd.Z.EntityFramework.csproj +++ b/src/Rdd.Z.EntityFramework/Rdd.Z.EntityFramework.csproj @@ -5,7 +5,7 @@ - + diff --git a/test/Rdd.Domain.Tests/Rdd.Domain.Tests.csproj b/test/Rdd.Domain.Tests/Rdd.Domain.Tests.csproj index 34751942..91017a5b 100644 --- a/test/Rdd.Domain.Tests/Rdd.Domain.Tests.csproj +++ b/test/Rdd.Domain.Tests/Rdd.Domain.Tests.csproj @@ -11,10 +11,10 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + all runtime; build; native; contentfiles; analyzers diff --git a/test/Rdd.Infra.Tests/Rdd.Infra.Tests.csproj b/test/Rdd.Infra.Tests/Rdd.Infra.Tests.csproj index 631d5aae..cd3613ee 100644 --- a/test/Rdd.Infra.Tests/Rdd.Infra.Tests.csproj +++ b/test/Rdd.Infra.Tests/Rdd.Infra.Tests.csproj @@ -11,14 +11,14 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers - + diff --git a/test/Rdd.Web.Tests/EfCoreMemoryLeakPrevention.cs b/test/Rdd.Web.Tests/EfCoreMemoryLeakPrevention.cs index 6b4863e2..9bfbcbb0 100644 --- a/test/Rdd.Web.Tests/EfCoreMemoryLeakPrevention.cs +++ b/test/Rdd.Web.Tests/EfCoreMemoryLeakPrevention.cs @@ -57,15 +57,12 @@ public async Task GenerateMultipleQueries() var coherentStateProperty = typeof(MemoryCache).GetField("_coherentState", BindingFlags.NonPublic | BindingFlags.Instance); var state = coherentStateProperty.GetValue(cache); - var entriesProperty = coherentStateProperty.FieldType.GetField("_entries", BindingFlags.NonPublic | BindingFlags.Instance); - var entries = entriesProperty.GetValue(state) as ICollection;// as ConcurrentDictionary; var items = new List(); - if (entries != null) + var allEntries = state.GetType().GetMethod("GetAllValues").Invoke(state, Array.Empty()) as IEnumerable; + if (allEntries != null) { - foreach (var item in entries) + foreach (ICacheEntry val in allEntries) { - var methodInfoVal = item.GetType().GetProperty("Value"); - var val = methodInfoVal.GetValue(item) as ICacheEntry; if (val?.Value == null) { continue; diff --git a/test/Rdd.Web.Tests/Rdd.Web.Tests.csproj b/test/Rdd.Web.Tests/Rdd.Web.Tests.csproj index 2e28ec90..4cf7a4e1 100644 --- a/test/Rdd.Web.Tests/Rdd.Web.Tests.csproj +++ b/test/Rdd.Web.Tests/Rdd.Web.Tests.csproj @@ -12,11 +12,11 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + all runtime; build; native; contentfiles; analyzers