|
|
@ -92,7 +92,8 @@ public class FindExtrasTests
|
|
|
|
"/movies/Up/behind the scenes",
|
|
|
|
"/movies/Up/behind the scenes",
|
|
|
|
"/movies/Up/behind the scenes.mkv",
|
|
|
|
"/movies/Up/behind the scenes.mkv",
|
|
|
|
"/movies/Up/Up - sample.mkv",
|
|
|
|
"/movies/Up/Up - sample.mkv",
|
|
|
|
"/movies/Up/Up something else.mkv"
|
|
|
|
"/movies/Up/Up something else.mkv",
|
|
|
|
|
|
|
|
"/movies/Up/extras"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
_fileSystemMock.Setup(f => f.GetFiles(
|
|
|
|
_fileSystemMock.Setup(f => f.GetFiles(
|
|
|
@ -140,6 +141,21 @@ public class FindExtrasTests
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).Verifiable();
|
|
|
|
}).Verifiable();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_fileSystemMock.Setup(f => f.GetFiles(
|
|
|
|
|
|
|
|
"/movies/Up/extras",
|
|
|
|
|
|
|
|
It.IsAny<string[]>(),
|
|
|
|
|
|
|
|
false,
|
|
|
|
|
|
|
|
false))
|
|
|
|
|
|
|
|
.Returns(new List<FileSystemMetadata>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
new()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
FullName = "/movies/Up/extras/Honest Trailer.mkv",
|
|
|
|
|
|
|
|
Name = "Honest Trailer.mkv",
|
|
|
|
|
|
|
|
IsDirectory = false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).Verifiable();
|
|
|
|
|
|
|
|
|
|
|
|
var files = paths.Select(p => new FileSystemMetadata
|
|
|
|
var files = paths.Select(p => new FileSystemMetadata
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FullName = p,
|
|
|
|
FullName = p,
|
|
|
@ -150,17 +166,19 @@ public class FindExtrasTests
|
|
|
|
var extras = _libraryManager.FindExtras(owner, files, new DirectoryService(_fileSystemMock.Object)).OrderBy(e => e.ExtraType).ToList();
|
|
|
|
var extras = _libraryManager.FindExtras(owner, files, new DirectoryService(_fileSystemMock.Object)).OrderBy(e => e.ExtraType).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
_fileSystemMock.Verify();
|
|
|
|
_fileSystemMock.Verify();
|
|
|
|
Assert.Equal(6, extras.Count);
|
|
|
|
Assert.Equal(7, extras.Count);
|
|
|
|
Assert.Equal(ExtraType.Trailer, extras[0].ExtraType);
|
|
|
|
Assert.Equal(ExtraType.Unknown, extras[0].ExtraType);
|
|
|
|
Assert.Equal(typeof(Trailer), extras[0].GetType());
|
|
|
|
Assert.Equal(typeof(Video), extras[0].GetType());
|
|
|
|
Assert.Equal(ExtraType.Trailer, extras[1].ExtraType);
|
|
|
|
Assert.Equal(ExtraType.Trailer, extras[1].ExtraType);
|
|
|
|
Assert.Equal(typeof(Trailer), extras[1].GetType());
|
|
|
|
Assert.Equal(typeof(Trailer), extras[1].GetType());
|
|
|
|
Assert.Equal(ExtraType.BehindTheScenes, extras[2].ExtraType);
|
|
|
|
Assert.Equal(ExtraType.Trailer, extras[2].ExtraType);
|
|
|
|
Assert.Equal(ExtraType.Sample, extras[3].ExtraType);
|
|
|
|
Assert.Equal(typeof(Trailer), extras[2].GetType());
|
|
|
|
Assert.Equal(ExtraType.ThemeSong, extras[4].ExtraType);
|
|
|
|
Assert.Equal(ExtraType.BehindTheScenes, extras[3].ExtraType);
|
|
|
|
Assert.Equal(typeof(Audio), extras[4].GetType());
|
|
|
|
Assert.Equal(ExtraType.Sample, extras[4].ExtraType);
|
|
|
|
Assert.Equal(ExtraType.ThemeSong, extras[5].ExtraType);
|
|
|
|
Assert.Equal(ExtraType.ThemeSong, extras[5].ExtraType);
|
|
|
|
Assert.Equal(typeof(Audio), extras[5].GetType());
|
|
|
|
Assert.Equal(typeof(Audio), extras[5].GetType());
|
|
|
|
|
|
|
|
Assert.Equal(ExtraType.ThemeSong, extras[6].ExtraType);
|
|
|
|
|
|
|
|
Assert.Equal(typeof(Audio), extras[6].GetType());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|