mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-25 22:36:59 -04:00
Refactor ExtraFile/MetadataFile Services (#104)
* Preliminary Work for Extras for Music * DB Migration for ExtraFiles, Other Cleanup * More Extras Work, Add Album Metadata Type * Update Housekeeps for Music Extras * Fix HouseKeeper and add new Tests * Final round of Cleanup
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using FizzWare.NBuilder;
|
||||
using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
@@ -11,7 +11,7 @@ namespace NzbDrone.Core.Test.MediaFiles
|
||||
public class MediaFileRepositoryFixture : DbTest<MediaFileRepository, TrackFile>
|
||||
{
|
||||
[Test]
|
||||
public void get_files_by_series()
|
||||
public void get_files_by_artist()
|
||||
{
|
||||
var files = Builder<TrackFile>.CreateListOfSize(10)
|
||||
.All()
|
||||
@@ -24,11 +24,11 @@ namespace NzbDrone.Core.Test.MediaFiles
|
||||
|
||||
Db.InsertMany(files);
|
||||
|
||||
var seriesFiles = Subject.GetFilesByArtist(12);
|
||||
var artistFiles = Subject.GetFilesByArtist(12);
|
||||
|
||||
seriesFiles.Should().HaveCount(4);
|
||||
seriesFiles.Should().OnlyContain(c => c.ArtistId == 12);
|
||||
artistFiles.Should().HaveCount(4);
|
||||
artistFiles.Should().OnlyContain(c => c.ArtistId == 12);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using FizzWare.NBuilder;
|
||||
@@ -88,7 +88,7 @@ namespace NzbDrone.Core.Test.MediaFiles
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_delete_files_that_dont_belong_to_any_episodes()
|
||||
public void should_delete_files_that_dont_belong_to_any_tracks()
|
||||
{
|
||||
var trackFiles = Builder<TrackFile>.CreateListOfSize(10)
|
||||
.Random(10)
|
||||
@@ -104,7 +104,7 @@ namespace NzbDrone.Core.Test.MediaFiles
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_unlink_episode_when_episodeFile_does_not_exist()
|
||||
public void should_unlink_track_when_trackFile_does_not_exist()
|
||||
{
|
||||
GivenTrackFiles(new List<TrackFile>());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user