From dbd45f3628d2bd07760e3f38bfad45d2e44c49e0 Mon Sep 17 00:00:00 2001 From: Alexandru Macocian Date: Sat, 4 Nov 2023 20:17:56 +0100 Subject: [PATCH] Fix tests --- Daybreak.Tests/Services/JsonLoggerProviderTests.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Daybreak.Tests/Services/JsonLoggerProviderTests.cs b/Daybreak.Tests/Services/JsonLoggerProviderTests.cs index 9651548d..acd122b7 100644 --- a/Daybreak.Tests/Services/JsonLoggerProviderTests.cs +++ b/Daybreak.Tests/Services/JsonLoggerProviderTests.cs @@ -1,8 +1,12 @@ -using Daybreak.Services.Logging; +using Daybreak.Configuration.Options; +using Daybreak.Services.Logging; using FluentAssertions; using LiteDB; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using NSubstitute.Extensions; +using System.Configuration; using System.IO; using System.Linq; using System.Logging; @@ -21,7 +25,9 @@ public void InitializeProvider() { File.Delete("Daybreak.db"); this.liteDatabase = new LiteDatabase("Daybreak.db"); - this.logsManager = new JsonLogsManager(this.liteDatabase.GetCollection()); + var options = Substitute.For>(); + options.Value.Returns(new LauncherOptions { PersistentLogging = true }); + this.logsManager = new JsonLogsManager(this.liteDatabase.GetCollection(), options); this.loggerProvider = new CVLoggerProvider(this.logsManager); }