Few fixes from last PR (#2160)
* Added a migration for existing ratings * Fixed duplicating web links and changed so it has the see more functionality. * One more unit test
This commit is contained in:
parent
cae8f45ad1
commit
ce04e7421b
5 changed files with 85 additions and 7 deletions
|
@ -381,6 +381,49 @@ public class ReaderServiceTests
|
|||
Assert.Equal("2", actualChapter.Range);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetNextChapterIdAsync_ShouldGetNextVolume_OnlyFloats()
|
||||
{
|
||||
// V1 -> V2
|
||||
await ResetDb();
|
||||
|
||||
var series = new SeriesBuilder("Test")
|
||||
.WithVolume(new VolumeBuilder("1.0")
|
||||
.WithChapter(new ChapterBuilder("1").Build())
|
||||
.Build())
|
||||
|
||||
.WithVolume(new VolumeBuilder("2.1")
|
||||
.WithChapter(new ChapterBuilder("21").Build())
|
||||
.Build())
|
||||
|
||||
.WithVolume(new VolumeBuilder("2.2")
|
||||
.WithChapter(new ChapterBuilder("31").Build())
|
||||
.Build())
|
||||
|
||||
.WithVolume(new VolumeBuilder("3.1")
|
||||
.WithChapter(new ChapterBuilder("31").Build())
|
||||
.Build())
|
||||
|
||||
|
||||
.Build();
|
||||
series.Library = new LibraryBuilder("Test LIb", LibraryType.Manga).Build();
|
||||
|
||||
_context.Series.Add(series);
|
||||
|
||||
_context.AppUser.Add(new AppUser()
|
||||
{
|
||||
UserName = "majora2007"
|
||||
});
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
|
||||
|
||||
var nextChapter = await _readerService.GetNextChapterIdAsync(1, 2, 2, 1);
|
||||
var actualChapter = await _unitOfWork.ChapterRepository.GetChapterAsync(nextChapter);
|
||||
Assert.Equal("31", actualChapter.Range);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetNextChapterIdAsync_ShouldRollIntoNextVolume()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue