Minor improvement

pull/2950/head
Bond_009 5 years ago
parent 735e7c3f7d
commit 851dda097e

@ -11,11 +11,11 @@ namespace Jellyfin.Naming.Tests.Video
{ {
private readonly NamingOptions _namingOptions = new NamingOptions(); private readonly NamingOptions _namingOptions = new NamingOptions();
private class ResolveFileTestData : IEnumerable<object?[]> private class ResolveFileTestData : IEnumerable<object[]>
{ {
public IEnumerator<object?[]> GetEnumerator() public IEnumerator<object[]> GetEnumerator()
{ {
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -24,7 +24,7 @@ namespace Jellyfin.Naming.Tests.Video
Name = "7 Psychos" Name = "7 Psychos"
} }
}; };
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -34,7 +34,7 @@ namespace Jellyfin.Naming.Tests.Video
Year = 2005 Year = 2005
} }
}; };
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -43,7 +43,7 @@ namespace Jellyfin.Naming.Tests.Video
Name = "American.Psycho", Name = "American.Psycho",
} }
}; };
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -55,7 +55,7 @@ namespace Jellyfin.Naming.Tests.Video
Format3D = "sbs", Format3D = "sbs",
} }
}; };
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -65,7 +65,7 @@ namespace Jellyfin.Naming.Tests.Video
Year = 2006 Year = 2006
} }
}; };
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -77,7 +77,7 @@ namespace Jellyfin.Naming.Tests.Video
Format3D = "sbs", Format3D = "sbs",
} }
}; };
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -89,7 +89,7 @@ namespace Jellyfin.Naming.Tests.Video
StubType = "bluray", StubType = "bluray",
} }
}; };
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -101,7 +101,7 @@ namespace Jellyfin.Naming.Tests.Video
StubType = "bluray", StubType = "bluray",
} }
}; };
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -113,7 +113,7 @@ namespace Jellyfin.Naming.Tests.Video
StubType = "bluray", StubType = "bluray",
} }
}; };
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -125,7 +125,7 @@ namespace Jellyfin.Naming.Tests.Video
StubType = "bluray", StubType = "bluray",
} }
}; };
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -136,7 +136,7 @@ namespace Jellyfin.Naming.Tests.Video
ExtraType = ExtraType.Trailer, ExtraType = ExtraType.Trailer,
} }
}; };
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -147,7 +147,7 @@ namespace Jellyfin.Naming.Tests.Video
ExtraType = ExtraType.Trailer, ExtraType = ExtraType.Trailer,
} }
}; };
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -157,7 +157,7 @@ namespace Jellyfin.Naming.Tests.Video
Year = 2006 Year = 2006
} }
}; };
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -167,7 +167,7 @@ namespace Jellyfin.Naming.Tests.Video
Year = 1995, Year = 1995,
} }
}; };
yield return new object?[] yield return new object[]
{ {
new VideoFileInfo() new VideoFileInfo()
{ {
@ -184,10 +184,11 @@ namespace Jellyfin.Naming.Tests.Video
[Theory] [Theory]
[ClassData(typeof(ResolveFileTestData))] [ClassData(typeof(ResolveFileTestData))]
public void ResolveFile_ValidFileName_Success(VideoFileInfo? expectedResult) public void ResolveFile_ValidFileName_Success(VideoFileInfo expectedResult)
{ {
var result = new VideoResolver(_namingOptions).ResolveFile(expectedResult.Path); var result = new VideoResolver(_namingOptions).ResolveFile(expectedResult.Path);
Assert.NotNull(result);
Assert.Equal(result.Path, expectedResult.Path); Assert.Equal(result.Path, expectedResult.Path);
Assert.Equal(result.Container, expectedResult.Container); Assert.Equal(result.Container, expectedResult.Container);
Assert.Equal(result.Name, expectedResult.Name); Assert.Equal(result.Name, expectedResult.Name);

Loading…
Cancel
Save