mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-25 22:36:59 -04:00
@@ -28,10 +28,23 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
|
||||
.With(s => s.Name = "Avenged Sevenfold")
|
||||
.Build();
|
||||
|
||||
var series = Builder<Series>
|
||||
.CreateNew()
|
||||
.With(x => x.Title = "Series Title")
|
||||
.Build();
|
||||
|
||||
var seriesLink = Builder<SeriesBookLink>
|
||||
.CreateListOfSize(1)
|
||||
.All()
|
||||
.With(s => s.Position = "1-2")
|
||||
.With(s => s.Series = series)
|
||||
.BuildListOfNew();
|
||||
|
||||
_book = Builder<Book>
|
||||
.CreateNew()
|
||||
.With(s => s.Title = "Hail to the King")
|
||||
.With(s => s.AuthorMetadata = _author.Metadata.Value)
|
||||
.With(s => s.SeriesLinks = seriesLink)
|
||||
.Build();
|
||||
|
||||
_edition = Builder<Edition>
|
||||
|
||||
+42
-2
@@ -35,10 +35,23 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
|
||||
})
|
||||
.Build();
|
||||
|
||||
var series = Builder<Series>
|
||||
.CreateNew()
|
||||
.With(x => x.Title = "Series Title")
|
||||
.Build();
|
||||
|
||||
var seriesLink = Builder<SeriesBookLink>
|
||||
.CreateListOfSize(1)
|
||||
.All()
|
||||
.With(s => s.Position = "1-2")
|
||||
.With(s => s.Series = series)
|
||||
.BuildListOfNew();
|
||||
|
||||
_book = Builder<Book>
|
||||
.CreateNew()
|
||||
.With(s => s.Title = "Hybrid Theory")
|
||||
.With(s => s.AuthorMetadata = _author.Metadata.Value)
|
||||
.With(s => s.SeriesLinks = seriesLink)
|
||||
.Build();
|
||||
|
||||
_edition = Builder<Edition>
|
||||
@@ -247,6 +260,33 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
|
||||
.Should().Be("Hybrid.Theory.2000");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_set_series()
|
||||
{
|
||||
_namingConfig.StandardBookFormat = "{Book Series}";
|
||||
|
||||
Subject.BuildBookFileName(_author, _edition, _trackFile)
|
||||
.Should().Be("Series Title");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_set_series_number()
|
||||
{
|
||||
_namingConfig.StandardBookFormat = "{Book SeriesPosition}";
|
||||
|
||||
Subject.BuildBookFileName(_author, _edition, _trackFile)
|
||||
.Should().Be("1-2");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_set_series_title()
|
||||
{
|
||||
_namingConfig.StandardBookFormat = "{Book SeriesTitle}";
|
||||
|
||||
Subject.BuildBookFileName(_author, _edition, _trackFile)
|
||||
.Should().Be("Series Title #1-2");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_set_part_number()
|
||||
{
|
||||
@@ -434,7 +474,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
|
||||
{
|
||||
_namingConfig.StandardBookFormat = "{Author.Name}.{Book.Title}";
|
||||
|
||||
Subject.BuildBookFileName(new Author { Name = "In The Woods." }, new Edition { Title = "30 Rock", Book = new Book { AuthorMetadata = new AuthorMetadata { Name = "Author" } } }, _trackFile)
|
||||
Subject.BuildBookFileName(new Author { Name = "In The Woods." }, new Edition { Title = "30 Rock", Book = new Book { AuthorMetadata = new AuthorMetadata { Name = "Author" }, SeriesLinks = new List<SeriesBookLink>() } }, _trackFile)
|
||||
.Should().Be("In.The.Woods.30.Rock");
|
||||
}
|
||||
|
||||
@@ -443,7 +483,7 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
|
||||
{
|
||||
_namingConfig.StandardBookFormat = "{Author.Name}.{Book.Title}";
|
||||
|
||||
Subject.BuildBookFileName(new Author { Name = "In The Woods..." }, new Edition { Title = "30 Rock", Book = new Book { AuthorMetadata = new AuthorMetadata { Name = "Author" } } }, _trackFile)
|
||||
Subject.BuildBookFileName(new Author { Name = "In The Woods..." }, new Edition { Title = "30 Rock", Book = new Book { AuthorMetadata = new AuthorMetadata { Name = "Author" }, SeriesLinks = new List<SeriesBookLink>() } }, _trackFile)
|
||||
.Should().Be("In.The.Woods.30.Rock");
|
||||
}
|
||||
|
||||
|
||||
@@ -28,10 +28,23 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
|
||||
.With(s => s.Name = "Alien Ant Farm")
|
||||
.Build();
|
||||
|
||||
var series = Builder<Series>
|
||||
.CreateNew()
|
||||
.With(x => x.Title = "Series Title")
|
||||
.Build();
|
||||
|
||||
var seriesLink = Builder<SeriesBookLink>
|
||||
.CreateListOfSize(1)
|
||||
.All()
|
||||
.With(s => s.Position = "1-2")
|
||||
.With(s => s.Series = series)
|
||||
.BuildListOfNew();
|
||||
|
||||
_book = Builder<Book>
|
||||
.CreateNew()
|
||||
.With(s => s.Title = "Anthology")
|
||||
.With(s => s.AuthorMetadata = _author.Metadata.Value)
|
||||
.With(s => s.SeriesLinks = seriesLink)
|
||||
.Build();
|
||||
|
||||
_edition = Builder<Edition>
|
||||
|
||||
Reference in New Issue
Block a user