You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
130 lines
4.3 KiB
130 lines
4.3 KiB
1 year ago
|
using Recyclarr.Cli.Pipelines.MediaNaming.PipelinePhases;
|
||
|
using Recyclarr.ServarrApi.MediaNaming;
|
||
|
|
||
|
namespace Recyclarr.Cli.Tests.Pipelines.MediaNaming;
|
||
|
|
||
|
[TestFixture]
|
||
|
public class MediaNamingTransactionPhaseSonarrTest
|
||
|
{
|
||
1 year ago
|
[Test] [AutoMockData]
|
||
1 year ago
|
public void Sonarr_left_null(
|
||
|
MediaNamingTransactionPhase sut)
|
||
|
{
|
||
|
var left = new SonarrMediaNamingDto();
|
||
|
|
||
|
var right = new ProcessedNamingConfig
|
||
|
{
|
||
|
Dto = new SonarrMediaNamingDto
|
||
|
{
|
||
|
RenameEpisodes = true,
|
||
|
SeasonFolderFormat = "season_default",
|
||
|
SeriesFolderFormat = "series_plex",
|
||
|
StandardEpisodeFormat = "episodes_standard_default_3",
|
||
|
DailyEpisodeFormat = "episodes_daily_default_3",
|
||
|
AnimeEpisodeFormat = "episodes_anime_default_3"
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var result = sut.Execute(left, right);
|
||
|
|
||
|
result.Should().BeEquivalentTo(right.Dto, o => o.RespectingRuntimeTypes());
|
||
|
}
|
||
|
|
||
1 year ago
|
[Test] [AutoMockData]
|
||
1 year ago
|
public void Sonarr_right_null(
|
||
|
MediaNamingTransactionPhase sut)
|
||
|
{
|
||
|
var left = new SonarrMediaNamingDto
|
||
|
{
|
||
|
RenameEpisodes = true,
|
||
|
SeasonFolderFormat = "season_default",
|
||
|
SeriesFolderFormat = "series_plex",
|
||
|
StandardEpisodeFormat = "episodes_standard_default_3",
|
||
|
DailyEpisodeFormat = "episodes_daily_default_3",
|
||
|
AnimeEpisodeFormat = "episodes_anime_default_3"
|
||
|
};
|
||
|
|
||
|
var right = new ProcessedNamingConfig
|
||
|
{
|
||
|
Dto = new SonarrMediaNamingDto()
|
||
|
};
|
||
|
|
||
|
var result = sut.Execute(left, right);
|
||
|
|
||
|
result.Should().BeEquivalentTo(left, o => o.RespectingRuntimeTypes());
|
||
|
}
|
||
|
|
||
1 year ago
|
[Test] [AutoMockData]
|
||
1 year ago
|
public void Sonarr_right_and_left_with_rename(
|
||
|
MediaNamingTransactionPhase sut)
|
||
|
{
|
||
|
var left = new SonarrMediaNamingDto
|
||
|
{
|
||
|
RenameEpisodes = false,
|
||
|
SeasonFolderFormat = "season_default",
|
||
|
SeriesFolderFormat = "series_plex",
|
||
|
StandardEpisodeFormat = "episodes_standard_default",
|
||
|
DailyEpisodeFormat = "episodes_daily_default",
|
||
|
AnimeEpisodeFormat = "episodes_anime_default"
|
||
|
};
|
||
|
|
||
|
var right = new ProcessedNamingConfig
|
||
|
{
|
||
|
Dto = new SonarrMediaNamingDto
|
||
|
{
|
||
|
RenameEpisodes = true,
|
||
|
SeasonFolderFormat = "season_default2",
|
||
|
SeriesFolderFormat = "series_plex2",
|
||
|
StandardEpisodeFormat = "episodes_standard_default2",
|
||
|
DailyEpisodeFormat = "episodes_daily_default2",
|
||
|
AnimeEpisodeFormat = "episodes_anime_default2"
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var result = sut.Execute(left, right);
|
||
|
|
||
|
result.Should().BeEquivalentTo(right.Dto, o => o.RespectingRuntimeTypes());
|
||
|
}
|
||
|
|
||
1 year ago
|
[Test] [AutoMockData]
|
||
1 year ago
|
public void Sonarr_right_and_left_without_rename(
|
||
|
MediaNamingTransactionPhase sut)
|
||
|
{
|
||
|
var left = new SonarrMediaNamingDto
|
||
|
{
|
||
|
RenameEpisodes = true,
|
||
|
SeasonFolderFormat = "season_default",
|
||
|
SeriesFolderFormat = "series_plex",
|
||
|
StandardEpisodeFormat = "episodes_standard_default",
|
||
|
DailyEpisodeFormat = "episodes_daily_default",
|
||
|
AnimeEpisodeFormat = "episodes_anime_default"
|
||
|
};
|
||
|
|
||
|
var right = new ProcessedNamingConfig
|
||
|
{
|
||
|
Dto = new SonarrMediaNamingDto
|
||
|
{
|
||
|
RenameEpisodes = false,
|
||
|
SeasonFolderFormat = "season_default2",
|
||
|
SeriesFolderFormat = "series_plex2",
|
||
|
StandardEpisodeFormat = "episodes_standard_default2",
|
||
|
DailyEpisodeFormat = "episodes_daily_default2",
|
||
|
AnimeEpisodeFormat = "episodes_anime_default2"
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var result = sut.Execute(left, right);
|
||
|
|
||
|
result.Should().BeEquivalentTo(new SonarrMediaNamingDto
|
||
|
{
|
||
|
RenameEpisodes = false,
|
||
|
SeasonFolderFormat = "season_default2",
|
||
|
SeriesFolderFormat = "series_plex2",
|
||
1 year ago
|
StandardEpisodeFormat = "episodes_standard_default2",
|
||
|
DailyEpisodeFormat = "episodes_daily_default2",
|
||
|
AnimeEpisodeFormat = "episodes_anime_default2"
|
||
1 year ago
|
},
|
||
|
o => o.RespectingRuntimeTypes());
|
||
|
}
|
||
|
}
|