Upgrade packages, fixed few formatting issues.
This commit is contained in:
parent
3fc44163a9
commit
85d6b820f3
6 changed files with 59 additions and 41 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [2.0.98] - 2025-02-16
|
||||
### Added
|
||||
- Added unit tests, thanks @Cucumberrbob!
|
||||
|
||||
### Changed
|
||||
- Fixed symlinks for AllDebrid.
|
||||
- Upgraded DebridLink.fr to the latest version.
|
||||
- Fixed nested files in the Premiumize Provider.
|
||||
- Fixed deleting of torrents in the watch folders.
|
||||
|
||||
## [2.0.97] - 2025-02-16
|
||||
### Added
|
||||
- Added support for DebridLink.fr.
|
||||
|
|
|
|||
|
|
@ -11,17 +11,24 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AllDebrid.NET" Version="1.0.17" />
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2"/>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1"/>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.4">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
|
||||
<PackageReference Include="Moq" Version="4.20.72" />
|
||||
<PackageReference Include="TestableIO.System.IO.Abstractions" Version="21.3.1" />
|
||||
<PackageReference Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="21.3.1" />
|
||||
<PackageReference Include="xunit" Version="2.9.2"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2"/>
|
||||
<PackageReference Include="TestableIO.System.IO.Abstractions" Version="22.0.10" />
|
||||
<PackageReference Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="22.0.10" />
|
||||
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="22.0.10" />
|
||||
<PackageReference Include="xunit" Version="2.9.3" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="Xunit"/>
|
||||
<Using Include="Xunit" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class DownloadStationDownloaderTest
|
|||
{
|
||||
// Arrange
|
||||
var mocks = new Mocks();
|
||||
mocks.TaskEndpointMock.Setup(t => t.GetInfoAsync(mocks.Gid)).ThrowsAsync(new Exception());
|
||||
mocks.TaskEndpointMock.Setup(t => t.GetInfoAsync(mocks.Gid)).ThrowsAsync(new());
|
||||
|
||||
mocks.TaskEndpointMock.Setup(t => t.ListAsync())
|
||||
.ReturnsAsync(new DownloadStationTaskListResponse
|
||||
|
|
@ -120,7 +120,7 @@ public class DownloadStationDownloaderTest
|
|||
public async Task Download_After5Tries_Throws()
|
||||
{
|
||||
var mocks = new Mocks();
|
||||
mocks.TaskEndpointMock.Setup(t => t.GetInfoAsync(mocks.Gid)).ThrowsAsync(new Exception());
|
||||
mocks.TaskEndpointMock.Setup(t => t.GetInfoAsync(mocks.Gid)).ThrowsAsync(new());
|
||||
|
||||
var emptyListResponse = new DownloadStationTaskListResponse
|
||||
{
|
||||
|
|
@ -136,11 +136,11 @@ public class DownloadStationDownloaderTest
|
|||
.ReturnsAsync(emptyListResponse);
|
||||
|
||||
mocks.TaskEndpointMock.SetupSequence(t => t.CreateAsync(It.IsAny<DownloadStationTaskCreateRequest>()))
|
||||
.ThrowsAsync(new Exception())
|
||||
.ThrowsAsync(new Exception())
|
||||
.ThrowsAsync(new Exception())
|
||||
.ThrowsAsync(new Exception())
|
||||
.ThrowsAsync(new Exception());
|
||||
.ThrowsAsync(new())
|
||||
.ThrowsAsync(new())
|
||||
.ThrowsAsync(new())
|
||||
.ThrowsAsync(new())
|
||||
.ThrowsAsync(new());
|
||||
|
||||
var downloadStationDownloader = new DownloadStationDownloader(mocks.Gid,
|
||||
"https://fake.url/file.txt",
|
||||
|
|
@ -166,7 +166,7 @@ public class DownloadStationDownloaderTest
|
|||
public async Task Download_WhenSuccessfulAfter4Tries_ReturnsGid()
|
||||
{
|
||||
var mocks = new Mocks();
|
||||
mocks.TaskEndpointMock.Setup(t => t.GetInfoAsync(mocks.Gid)).ThrowsAsync(new Exception());
|
||||
mocks.TaskEndpointMock.Setup(t => t.GetInfoAsync(mocks.Gid)).ThrowsAsync(new());
|
||||
|
||||
var emptyListResponse = new DownloadStationTaskListResponse
|
||||
{
|
||||
|
|
@ -182,10 +182,10 @@ public class DownloadStationDownloaderTest
|
|||
.ReturnsAsync(emptyListResponse);
|
||||
|
||||
mocks.TaskEndpointMock.SetupSequence(t => t.CreateAsync(It.IsAny<DownloadStationTaskCreateRequest>()))
|
||||
.ThrowsAsync(new Exception())
|
||||
.ThrowsAsync(new Exception())
|
||||
.ThrowsAsync(new Exception())
|
||||
.ThrowsAsync(new Exception())
|
||||
.ThrowsAsync(new())
|
||||
.ThrowsAsync(new())
|
||||
.ThrowsAsync(new())
|
||||
.ThrowsAsync(new())
|
||||
.ReturnsAsync(new DownloadStationTaskCreateResponse
|
||||
{
|
||||
TaskId = [mocks.Gid]
|
||||
|
|
|
|||
|
|
@ -208,9 +208,9 @@ public class AllDebridTorrentClientTest
|
|||
var secondResult = await allDebridTorrentClient.GetTorrents();
|
||||
|
||||
// Assert
|
||||
Assert.Equal(1, firstResult.Count);
|
||||
Assert.Single(firstResult);
|
||||
Assert.Equal(Magnet1Finished.Id.ToString(), firstResult.First().Id);
|
||||
Assert.Equal(1, secondResult.Count);
|
||||
Assert.Single(secondResult);
|
||||
Assert.Equal(Magnet2Finished.Id.ToString(), secondResult.First().Id);
|
||||
}
|
||||
|
||||
|
|
@ -244,7 +244,7 @@ public class AllDebridTorrentClientTest
|
|||
var secondResult = await allDebridTorrentClient.GetTorrents();
|
||||
|
||||
// Assert
|
||||
Assert.Equal(1, firstResult.Count);
|
||||
Assert.Single(firstResult);
|
||||
Assert.Equal(Magnet1Finished.Id.ToString(), firstResult[0].Id);
|
||||
Assert.Equal(2, secondResult.Count);
|
||||
Assert.Contains(secondResult, t => t.Id == Magnet1Finished.Id.ToString());
|
||||
|
|
@ -696,9 +696,9 @@ public class AllDebridTorrentClientTest
|
|||
|
||||
public Mocks()
|
||||
{
|
||||
LoggerMock = new Mock<ILogger<AllDebridTorrentClient>>();
|
||||
AllDebridClientMock = new Mock<IAllDebridNETClient>();
|
||||
AllDebridClientFactoryMock = new Mock<IAllDebridNetClientFactory>();
|
||||
LoggerMock = new();
|
||||
AllDebridClientMock = new();
|
||||
AllDebridClientFactoryMock = new();
|
||||
AllDebridClientFactoryMock.Setup(f => f.GetClient()).Returns(AllDebridClientMock.Object);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class TorrentsTest
|
|||
Hash = "123ABC",
|
||||
Category = "Movies",
|
||||
RdSize = 100,
|
||||
TorrentId = new Guid()
|
||||
TorrentId = Guid.Empty
|
||||
};
|
||||
|
||||
List<Download> downloads =
|
||||
|
|
@ -58,10 +58,10 @@ public class TorrentsTest
|
|||
}
|
||||
];
|
||||
|
||||
yield return new Object[]
|
||||
{
|
||||
yield return
|
||||
[
|
||||
torrent, downloads
|
||||
};
|
||||
];
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
@ -71,7 +71,7 @@ public class TorrentsTest
|
|||
// Arrange
|
||||
var settings = new DbSettings
|
||||
{
|
||||
General = new DbSettingsGeneral()
|
||||
General = new()
|
||||
{
|
||||
RunOnTorrentCompleteFileName = "/bin/echo",
|
||||
RunOnTorrentCompleteArguments = "%N %L %F %R %D %C %Z %I"
|
||||
|
|
@ -90,7 +90,7 @@ public class TorrentsTest
|
|||
var fileSystemMock = new MockFileSystem(new Dictionary<String, MockFileData>
|
||||
{
|
||||
{
|
||||
filePath, new MockFileData("Test file")
|
||||
filePath, new("Test file")
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -134,7 +134,7 @@ public class TorrentsTest
|
|||
// Arrange
|
||||
var settings = new DbSettings()
|
||||
{
|
||||
General = new DbSettingsGeneral()
|
||||
General = new()
|
||||
{
|
||||
RunOnTorrentCompleteFileName = null
|
||||
}
|
||||
|
|
@ -152,7 +152,7 @@ public class TorrentsTest
|
|||
var fileSystemMock = new MockFileSystem(new Dictionary<String, MockFileData>
|
||||
{
|
||||
{
|
||||
filePath, new MockFileData("Test file")
|
||||
filePath, new("Test file")
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ public class TorrentsTest
|
|||
// Arrange
|
||||
var settings = new DbSettings()
|
||||
{
|
||||
General = new DbSettingsGeneral()
|
||||
General = new()
|
||||
{
|
||||
RunOnTorrentCompleteFileName = "/bin/echo"
|
||||
}
|
||||
|
|
@ -199,7 +199,7 @@ public class TorrentsTest
|
|||
var fileSystemMock = new MockFileSystem(new Dictionary<String, MockFileData>
|
||||
{
|
||||
{
|
||||
filePath, new MockFileData("Test file")
|
||||
filePath, new("Test file")
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -247,7 +247,7 @@ public class TorrentsTest
|
|||
// Arrange
|
||||
var settings = new DbSettings()
|
||||
{
|
||||
General = new DbSettingsGeneral()
|
||||
General = new()
|
||||
{
|
||||
RunOnTorrentCompleteFileName = "/bin/echo"
|
||||
}
|
||||
|
|
@ -265,7 +265,7 @@ public class TorrentsTest
|
|||
var fileSystemMock = new MockFileSystem(new Dictionary<String, MockFileData>
|
||||
{
|
||||
{
|
||||
filePath, new MockFileData("Test file")
|
||||
filePath, new("Test file")
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -18,13 +18,14 @@
|
|||
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.2.0" />
|
||||
<PackageReference Include="MonoTorrent" Version="3.0.2" />
|
||||
<PackageReference Include="Polly" Version="8.5.2" />
|
||||
<PackageReference Include="Premiumize.NET" Version="1.0.4" />
|
||||
<PackageReference Include="RD.NET" Version="2.1.6" />
|
||||
<PackageReference Include="Premiumize.NET" Version="1.0.9" />
|
||||
<PackageReference Include="RD.NET" Version="2.1.7" />
|
||||
<PackageReference Include="Serilog" Version="4.2.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
|
||||
<PackageReference Include="SharpCompress" Version="0.39.0" />
|
||||
<PackageReference Include="Synology.Api.Client" Version="0.3.87" />
|
||||
<PackageReference Include="TestableIO.System.IO.Abstractions" Version="21.3.1" />
|
||||
<PackageReference Include="Synology.Api.Client" Version="0.3.91" />
|
||||
<PackageReference Include="TestableIO.System.IO.Abstractions" Version="22.0.10" />
|
||||
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="22.0.10" />
|
||||
<PackageReference Include="TorBox.NET" Version="1.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue