no message
This commit is contained in:
parent
68edd4d80d
commit
a82e895a03
8 changed files with 10 additions and 23 deletions
|
|
@ -3,7 +3,6 @@ using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Moq;
|
using Moq;
|
||||||
using RdtClient.Data.Models.Data;
|
using RdtClient.Data.Models.Data;
|
||||||
using RdtClient.Data.Models.Internal;
|
|
||||||
using RdtClient.Service.BackgroundServices;
|
using RdtClient.Service.BackgroundServices;
|
||||||
using RdtClient.Service.Services;
|
using RdtClient.Service.Services;
|
||||||
|
|
||||||
|
|
@ -25,7 +24,7 @@ public class WatchFolderCheckerTests : IDisposable
|
||||||
_serviceProviderMock = new();
|
_serviceProviderMock = new();
|
||||||
_serviceScopeMock = new();
|
_serviceScopeMock = new();
|
||||||
_scopeServiceProviderMock = new();
|
_scopeServiceProviderMock = new();
|
||||||
_settings = new(new DbSettings
|
_settings = new(new()
|
||||||
{
|
{
|
||||||
Watch = new()
|
Watch = new()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ using System.Text;
|
||||||
using Moq;
|
using Moq;
|
||||||
using RdtClient.Data.Enums;
|
using RdtClient.Data.Enums;
|
||||||
using RdtClient.Data.Models.Data;
|
using RdtClient.Data.Models.Data;
|
||||||
using TestSettings = RdtClient.Service.Services.TestSettings;
|
|
||||||
using TorrentRunnerState = RdtClient.Service.Services.TorrentRunnerState;
|
using TorrentRunnerState = RdtClient.Service.Services.TorrentRunnerState;
|
||||||
using TorrentsService = RdtClient.Service.Services.Torrents;
|
using TorrentsService = RdtClient.Service.Services.Torrents;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using RdtClient.Data.Models.Internal;
|
using RdtClient.Data.Models.Internal;
|
||||||
|
using RdtClient.Service.Services;
|
||||||
|
|
||||||
namespace RdtClient.Service.Services;
|
namespace RdtClient.Service.Test;
|
||||||
|
|
||||||
internal sealed class TestSettings(DbSettings? settings = null) : ISettings
|
internal sealed class TestSettings(DbSettings? settings = null) : ISettings
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ public static class DiConfig
|
||||||
services.AddScoped<AllDebridDebridClient>();
|
services.AddScoped<AllDebridDebridClient>();
|
||||||
|
|
||||||
services.AddSingleton<IRateLimitCoordinator, RateLimitCoordinator>();
|
services.AddSingleton<IRateLimitCoordinator, RateLimitCoordinator>();
|
||||||
services.AddSingleton<ITorrentRunnerState>(TorrentRunner.SharedState);
|
services.AddSingleton(TorrentRunner.SharedState);
|
||||||
services.AddSingleton<IProcessFactory, ProcessFactory>();
|
services.AddSingleton<IProcessFactory, ProcessFactory>();
|
||||||
services.AddSingleton<IFileSystem, FileSystem>();
|
services.AddSingleton<IFileSystem, FileSystem>();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,30 +12,22 @@ public class QBittorrentControllerTest
|
||||||
{
|
{
|
||||||
private readonly QBittorrentController _controller;
|
private readonly QBittorrentController _controller;
|
||||||
private readonly Mock<QBittorrent> _qBittorrentMock;
|
private readonly Mock<QBittorrent> _qBittorrentMock;
|
||||||
<<<<<<< .merge_file_2jl9Ws
|
|
||||||
private readonly Mock<Torrents> _torrentsMock;
|
private readonly Mock<Torrents> _torrentsMock;
|
||||||
|
|
||||||
public QBittorrentControllerTest()
|
|
||||||
{
|
|
||||||
_qBittorrentMock = new(new Mock<ILogger<QBittorrent>>().Object, null!, null!, null!, null!);
|
|
||||||
_torrentsMock = new(null!, null!, null!, null!, null!, null!, null!, null!, null!, null!, null!);
|
|
||||||
|
|
||||||
_controller = new(new Mock<ILogger<QBittorrentController>>().Object, _qBittorrentMock.Object, new Mock<IHttpClientFactory>().Object, _torrentsMock.Object);
|
|
||||||
=======
|
|
||||||
private readonly TestSettings _settings;
|
private readonly TestSettings _settings;
|
||||||
|
|
||||||
public QBittorrentControllerTest()
|
public QBittorrentControllerTest()
|
||||||
{
|
{
|
||||||
_settings = new();
|
_settings = new();
|
||||||
_qBittorrentMock = new(new Mock<ILogger<QBittorrent>>().Object, _settings, null!, null!, null!, new TorrentRunnerState());
|
_qBittorrentMock = new(new Mock<ILogger<QBittorrent>>().Object, _settings, null!, null!, null!, new TorrentRunnerState());
|
||||||
|
_torrentsMock = new(null!, null!, null!, null!, null!, null!, null!, null!, null!, null!, null!, _settings, new TorrentRunnerState());
|
||||||
|
|
||||||
_controller = new(
|
_controller = new(
|
||||||
new Mock<ILogger<QBittorrentController>>().Object,
|
new Mock<ILogger<QBittorrentController>>().Object,
|
||||||
_qBittorrentMock.Object,
|
_qBittorrentMock.Object,
|
||||||
new Mock<IHttpClientFactory>().Object,
|
new Mock<IHttpClientFactory>().Object,
|
||||||
_settings);
|
_settings,
|
||||||
|
_torrentsMock.Object);
|
||||||
|
|
||||||
>>>>>>> .merge_file_I8bokE
|
|
||||||
_controller.ControllerContext = new()
|
_controller.ControllerContext = new()
|
||||||
{
|
{
|
||||||
HttpContext = new DefaultHttpContext()
|
HttpContext = new DefaultHttpContext()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using RdtClient.Data.Models.Internal;
|
using RdtClient.Data.Models.Internal;
|
||||||
|
using RdtClient.Service.Services;
|
||||||
|
|
||||||
namespace RdtClient.Service.Services;
|
namespace RdtClient.Web.Test;
|
||||||
|
|
||||||
internal sealed class TestSettings(DbSettings? settings = null) : ISettings
|
internal sealed class TestSettings(DbSettings? settings = null) : ISettings
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,7 @@ namespace RdtClient.Web.Controllers;
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/v2")]
|
[Route("api/v2")]
|
||||||
[Route("qbittorrent/api/v2")]
|
[Route("qbittorrent/api/v2")]
|
||||||
<<<<<<< .merge_file_3yoKAx
|
public class QBittorrentController(ILogger<QBittorrentController> logger, QBittorrent qBittorrent, IHttpClientFactory httpClientFactory, ISettings settings, Torrents torrents) : Controller
|
||||||
public class QBittorrentController(ILogger<QBittorrentController> logger, QBittorrent qBittorrent, IHttpClientFactory httpClientFactory, Torrents torrents) : Controller
|
|
||||||
=======
|
|
||||||
public class QBittorrentController(ILogger<QBittorrentController> logger, QBittorrent qBittorrent, IHttpClientFactory httpClientFactory, ISettings settings) : Controller
|
|
||||||
>>>>>>> .merge_file_cLOJCF
|
|
||||||
{
|
{
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[Route("/version/api")]
|
[Route("/version/api")]
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ using System.Reflection;
|
||||||
using Aria2NET;
|
using Aria2NET;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using RdtClient.Data.Data;
|
|
||||||
using RdtClient.Data.Models.Data;
|
using RdtClient.Data.Models.Data;
|
||||||
using RdtClient.Data.Models.Internal;
|
using RdtClient.Data.Models.Internal;
|
||||||
using RdtClient.Service.Helpers;
|
using RdtClient.Service.Helpers;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue