mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-24 13:36:50 +01:00
Move duplicate concrete IAbstractHttpClientFactorys to Common.HttpClientFactory
This commit is contained in:
@@ -12,6 +12,7 @@ using Tgstation.Server.Api.Models;
|
||||
using Tgstation.Server.Api.Models.Request;
|
||||
using Tgstation.Server.Client;
|
||||
using Tgstation.Server.Client.Components;
|
||||
using Tgstation.Server.Common;
|
||||
using Tgstation.Server.Host.Components.Byond;
|
||||
using Tgstation.Server.Host.Configuration;
|
||||
using Tgstation.Server.Host.IO;
|
||||
@@ -102,21 +103,22 @@ namespace Tgstation.Server.Tests.Live.Instance
|
||||
var generalConfigOptionsMock = new Mock<IOptions<GeneralConfiguration>>();
|
||||
generalConfigOptionsMock.SetupGet(x => x.Value).Returns(new GeneralConfiguration());
|
||||
|
||||
var byondInstaller = new PlatformIdentifier().IsWindows
|
||||
? (IByondInstaller)new WindowsByondInstaller(
|
||||
var assemblyInformationProvider = new AssemblyInformationProvider();
|
||||
var fileDownloader = new FileDownloader(
|
||||
new HttpClientFactory(assemblyInformationProvider.ProductInfoHeaderValue),
|
||||
Mock.Of<ILogger<FileDownloader>>());
|
||||
|
||||
IByondInstaller byondInstaller = new PlatformIdentifier().IsWindows
|
||||
? new WindowsByondInstaller(
|
||||
Mock.Of<IProcessExecutor>(),
|
||||
Mock.Of<IIOManager>(),
|
||||
new FileDownloader(
|
||||
new ConcreteHttpClientFactory(),
|
||||
Mock.Of<ILogger<FileDownloader>>()),
|
||||
fileDownloader,
|
||||
generalConfigOptionsMock.Object,
|
||||
Mock.Of<ILogger<WindowsByondInstaller>>())
|
||||
: new PosixByondInstaller(
|
||||
Mock.Of<IPostWriteHandler>(),
|
||||
Mock.Of<IIOManager>(),
|
||||
new FileDownloader(
|
||||
new ConcreteHttpClientFactory(),
|
||||
Mock.Of<ILogger<FileDownloader>>()),
|
||||
fileDownloader,
|
||||
Mock.Of<ILogger<PosixByondInstaller>>());
|
||||
|
||||
using var windowsByondInstaller = byondInstaller as WindowsByondInstaller;
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
using Tgstation.Server.Common;
|
||||
using Tgstation.Server.Host.Utils;
|
||||
|
||||
namespace Tgstation.Server.Tests.Live.Instance
|
||||
{
|
||||
sealed class ConcreteHttpClientFactory : IAbstractHttpClientFactory
|
||||
{
|
||||
public IHttpClient CreateClient() => new HttpClient();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user