From 58a58bcae02b97f74a4a61b7f80cae022a349824 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Thu, 31 Jul 2025 23:21:58 -0400 Subject: [PATCH] Fix failing unit test --- .../Engine/TestPosixByondInstaller.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/Tgstation.Server.Host.Tests/Components/Engine/TestPosixByondInstaller.cs b/tests/Tgstation.Server.Host.Tests/Components/Engine/TestPosixByondInstaller.cs index 6dbfb155b4..ba6e107699 100644 --- a/tests/Tgstation.Server.Host.Tests/Components/Engine/TestPosixByondInstaller.cs +++ b/tests/Tgstation.Server.Host.Tests/Components/Engine/TestPosixByondInstaller.cs @@ -1,15 +1,18 @@ -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Moq; -using System; +using System; using System.IO; +using System.IO.Abstractions.TestingHelpers; using System.Linq; using System.Reflection; +using System.Threading; using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using Moq; + using Tgstation.Server.Api.Models; -using Tgstation.Server.Api.Models.Internal; using Tgstation.Server.Host.Configuration; using Tgstation.Server.Host.IO; @@ -96,6 +99,10 @@ namespace Tgstation.Server.Host.Components.Engine.Tests public async Task TestInstallByond() { var mockIOManager = new Mock(); + mockIOManager.Setup(x => x.FileExists(It.IsNotNull(), It.IsAny())).ReturnsAsync(true); + mockIOManager.Setup(x => x.CreateResolverForSubdirectory(It.IsNotNull())).Returns(mockIOManager.Object); + mockIOManager.Setup(x => x.ConcatPath(It.IsNotNull())).Returns(Path.Combine); + mockIOManager.Setup(x => x.ResolvePath(It.IsNotNull())).Returns(path => path); var mockPostWriteHandler = new Mock(); var mockLogger = new Mock>(); var mockFileDownloader = Mock.Of();