From 756b0f1270d540bb6516c44cd4202997a64e9dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Luthi?= Date: Sat, 3 Jun 2023 15:03:22 +0200 Subject: [PATCH 1/2] Fix `TheRegistrationIndexResponseIsSortedByVersion` test The implicit conversion from the default DateTime to DateTimeOffset was throwing `System.ArgumentOutOfRangeException` > The UTC time represented when the offset is applied must be between year 0 and 10,000. (Parameter 'offset') --- tests/BaGet.Core.Tests/Metadata/RegistrationBuilderTests.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/BaGet.Core.Tests/Metadata/RegistrationBuilderTests.cs b/tests/BaGet.Core.Tests/Metadata/RegistrationBuilderTests.cs index 361257401..98ce44164 100644 --- a/tests/BaGet.Core.Tests/Metadata/RegistrationBuilderTests.cs +++ b/tests/BaGet.Core.Tests/Metadata/RegistrationBuilderTests.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using Moq; @@ -60,6 +61,7 @@ private Package GetTestPackage(string packageId, string version) PackageTypes = new List { new PackageType { Name = "test" } }, Dependencies = new List { }, Version = new NuGetVersion(version), + Published = new DateTime(2003, 1, 4, 15, 9, 26, 535), }; } } From 01ee9aeb9c2f6d97bba8179dcd26005179cb65f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Luthi?= Date: Sat, 3 Jun 2023 15:05:46 +0200 Subject: [PATCH 2/2] Fix HostIntegrationTests Resolving services from the root provider was throwing `System.InvalidOperationException` > Cannot resolve scoped service 'BaGet.Core.IContext' from root provider. --- tests/BaGet.Tests/HostIntegrationTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/BaGet.Tests/HostIntegrationTests.cs b/tests/BaGet.Tests/HostIntegrationTests.cs index 618d78adc..3ad9428e3 100644 --- a/tests/BaGet.Tests/HostIntegrationTests.cs +++ b/tests/BaGet.Tests/HostIntegrationTests.cs @@ -69,7 +69,7 @@ private IServiceProvider BuildServiceProvider(Dictionary configs }) .Build(); - return host.Services; + return host.Services.CreateScope().ServiceProvider; } } }