From 08c97ea6b3198b998b808b6e1dbfc670352be305 Mon Sep 17 00:00:00 2001 From: "Eric J. Smith" Date: Fri, 11 Oct 2024 16:49:24 -0500 Subject: [PATCH] Fix failing tests --- tests/Exceptionless.Tests/IntegrationTestsBase.cs | 2 +- tests/Exceptionless.Tests/TestWithServices.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/Exceptionless.Tests/IntegrationTestsBase.cs b/tests/Exceptionless.Tests/IntegrationTestsBase.cs index 808e616cbf..f2250914c8 100644 --- a/tests/Exceptionless.Tests/IntegrationTestsBase.cs +++ b/tests/Exceptionless.Tests/IntegrationTestsBase.cs @@ -100,7 +100,7 @@ protected virtual void RegisterServices(IServiceCollection services) // use xunit test logger services.AddSingleton(Log); services.AddSingleton(typeof(ILogger<>), typeof(Logger<>)); - services.AddSingleton(_ => new ProxyTimeProvider()); + services.ReplaceSingleton(_ => new ProxyTimeProvider()); services.AddSingleton(); services.AddSingleton(); diff --git a/tests/Exceptionless.Tests/TestWithServices.cs b/tests/Exceptionless.Tests/TestWithServices.cs index 5e26fe8255..cc6e124af6 100644 --- a/tests/Exceptionless.Tests/TestWithServices.cs +++ b/tests/Exceptionless.Tests/TestWithServices.cs @@ -1,5 +1,6 @@ using Exceptionless.Core; using Exceptionless.Core.Authentication; +using Exceptionless.Core.Extensions; using Exceptionless.Core.Mail; using Exceptionless.Helpers; using Exceptionless.Insulation.Configuration; @@ -59,9 +60,9 @@ protected virtual void RegisterServices(IServiceCollection services, AppOptions { services.AddSingleton(Log); services.AddSingleton(typeof(ILogger<>), typeof(Logger<>)); - services.AddSingleton(_ => new ProxyTimeProvider()); Web.Bootstrapper.RegisterServices(services, options, Log); Bootstrapper.RegisterServices(services, options); + services.ReplaceSingleton(_ => new ProxyTimeProvider()); services.AddSingleton(); services.AddSingleton();