Fix compile warnings in Jellyfin.Naming.Tests

pull/3105/head
aled 5 years ago
parent 92299be64c
commit 2849d2b134

@ -23,9 +23,9 @@ namespace Jellyfin.Naming.Tests.Subtitles
var result = parser.ParseFile(input);
Assert.Equal(language, result.Language, true);
Assert.Equal(isDefault, result.IsDefault);
Assert.Equal(isForced, result.IsForced);
Assert.Equal(language, result?.Language, true);
Assert.Equal(isDefault, result?.IsDefault);
Assert.Equal(isForced, result?.IsForced);
}
[Theory]

@ -21,7 +21,7 @@ namespace Jellyfin.Naming.Tests.TV
var result = new EpisodeResolver(options)
.Resolve(path, false, null, null, true);
Assert.Equal(episodeNumber, result.EpisodeNumber);
Assert.Equal(episodeNumber, result?.EpisodeNumber);
}
}
}

@ -23,12 +23,12 @@ namespace Jellyfin.Naming.Tests.TV
var result = new EpisodeResolver(options)
.Resolve(path, false);
Assert.Null(result.SeasonNumber);
Assert.Null(result.EpisodeNumber);
Assert.Equal(year, result.Year);
Assert.Equal(month, result.Month);
Assert.Equal(day, result.Day);
Assert.Equal(seriesName, result.SeriesName, true);
Assert.Null(result?.SeasonNumber);
Assert.Null(result?.EpisodeNumber);
Assert.Equal(year, result?.Year);
Assert.Equal(month, result?.Month);
Assert.Equal(day, result?.Day);
Assert.Equal(seriesName, result?.SeriesName, true);
}
}
}

@ -30,7 +30,7 @@ namespace Jellyfin.Naming.Tests.TV
var result = new EpisodeResolver(options)
.Resolve(path, false);
Assert.Equal(episodeNumber, result.EpisodeNumber);
Assert.Equal(episodeNumber, result?.EpisodeNumber);
}
}
}

@ -19,9 +19,9 @@ namespace Jellyfin.Naming.Tests.TV
var result = new EpisodeResolver(options)
.Resolve(path, false);
Assert.Equal(seasonNumber, result.SeasonNumber);
Assert.Equal(episodeNumber, result.EpisodeNumber);
Assert.Equal(seriesName, result.SeriesName, true);
Assert.Equal(seasonNumber, result?.SeasonNumber);
Assert.Equal(episodeNumber, result?.EpisodeNumber);
Assert.Equal(seriesName, result?.SeriesName, ignoreCase: true);
}
}
}

@ -59,7 +59,7 @@ namespace Jellyfin.Naming.Tests.TV
var result = new EpisodeResolver(_namingOptions)
.Resolve(path, false);
Assert.Equal(expected, result.SeasonNumber);
Assert.Equal(expected, result?.SeasonNumber);
}
}
}

@ -31,9 +31,9 @@ namespace Jellyfin.Naming.Tests.TV
var result = new EpisodeResolver(options)
.Resolve(path, false);
Assert.Equal(seasonNumber, result.SeasonNumber);
Assert.Equal(episodeNumber, result.EpisodeNumber);
Assert.Equal(seriesName, result.SeriesName, true);
Assert.Equal(seasonNumber, result?.SeasonNumber);
Assert.Equal(episodeNumber, result?.EpisodeNumber);
Assert.Equal(seriesName, result?.SeriesName, true);
}
}
}

@ -25,8 +25,8 @@ namespace Jellyfin.Naming.Tests.Video
var result =
new VideoResolver(_namingOptions).ResolveFile(@"C:/Users/media/Desktop/Video Test/Movies/Oblivion/Oblivion.3d.hsbs.mkv");
Assert.Equal("hsbs", result.Format3D);
Assert.Equal("Oblivion", result.Name);
Assert.Equal("hsbs", result?.Format3D);
Assert.Equal("Oblivion", result?.Name);
}
[Fact]

@ -12,7 +12,7 @@ namespace Jellyfin.Naming.Tests.Video
// FIXME
// [Fact]
public void TestMultiEdition1()
private void TestMultiEdition1()
{
var files = new[]
{
@ -37,7 +37,7 @@ namespace Jellyfin.Naming.Tests.Video
// FIXME
// [Fact]
public void TestMultiEdition2()
private void TestMultiEdition2()
{
var files = new[]
{
@ -85,7 +85,7 @@ namespace Jellyfin.Naming.Tests.Video
// FIXME
// [Fact]
public void TestLetterFolders()
private void TestLetterFolders()
{
var files = new[]
{
@ -114,7 +114,7 @@ namespace Jellyfin.Naming.Tests.Video
// FIXME
// [Fact]
public void TestMultiVersionLimit()
private void TestMultiVersionLimit()
{
var files = new[]
{
@ -144,7 +144,7 @@ namespace Jellyfin.Naming.Tests.Video
// FIXME
// [Fact]
public void TestMultiVersionLimit2()
private void TestMultiVersionLimit2()
{
var files = new[]
{
@ -175,7 +175,7 @@ namespace Jellyfin.Naming.Tests.Video
// FIXME
// [Fact]
public void TestMultiVersion3()
private void TestMultiVersion3()
{
var files = new[]
{
@ -202,7 +202,7 @@ namespace Jellyfin.Naming.Tests.Video
// FIXME
// [Fact]
public void TestMultiVersion4()
private void TestMultiVersion4()
{
// Test for false positive
@ -231,7 +231,7 @@ namespace Jellyfin.Naming.Tests.Video
// FIXME
// [Fact]
public void TestMultiVersion5()
private void TestMultiVersion5()
{
var files = new[]
{
@ -264,7 +264,7 @@ namespace Jellyfin.Naming.Tests.Video
// FIXME
// [Fact]
public void TestMultiVersion6()
private void TestMultiVersion6()
{
var files = new[]
{
@ -297,7 +297,7 @@ namespace Jellyfin.Naming.Tests.Video
// FIXME
// [Fact]
public void TestMultiVersion7()
private void TestMultiVersion7()
{
var files = new[]
{
@ -319,7 +319,7 @@ namespace Jellyfin.Naming.Tests.Video
// FIXME
// [Fact]
public void TestMultiVersion8()
private void TestMultiVersion8()
{
// This is not actually supported yet
@ -353,7 +353,7 @@ namespace Jellyfin.Naming.Tests.Video
// FIXME
// [Fact]
public void TestMultiVersion9()
private void TestMultiVersion9()
{
// Test for false positive
@ -382,7 +382,7 @@ namespace Jellyfin.Naming.Tests.Video
// FIXME
// [Fact]
public void TestMultiVersion10()
private void TestMultiVersion10()
{
var files = new[]
{
@ -406,7 +406,7 @@ namespace Jellyfin.Naming.Tests.Video
// FIXME
// [Fact]
public void TestMultiVersion11()
private void TestMultiVersion11()
{
// Currently not supported but we should probably handle this.

@ -31,10 +31,10 @@ namespace Jellyfin.Naming.Tests.Video
var result =
new VideoResolver(_namingOptions).ResolveFile(@"C:/Users/media/Desktop/Video Test/Movies/Oblivion/Oblivion.dvd.disc");
Assert.Equal("Oblivion", result.Name);
Assert.Equal("Oblivion", result?.Name);
}
private void Test(string path, bool isStub, string stubType)
private void Test(string path, bool isStub, string? stubType)
{
var isStubResult = StubResolver.TryResolveFile(path, _namingOptions, out var stubTypeResult);

@ -11,7 +11,7 @@ namespace Jellyfin.Naming.Tests.Video
private readonly NamingOptions _namingOptions = new NamingOptions();
// FIXME
// [Fact]
public void TestStackAndExtras()
private void TestStackAndExtras()
{
// No stacking here because there is no part/disc/etc
var files = new[]

@ -184,17 +184,17 @@ namespace Jellyfin.Naming.Tests.Video
var result = new VideoResolver(_namingOptions).ResolveFile(expectedResult.Path);
Assert.NotNull(result);
Assert.Equal(result.Path, expectedResult.Path);
Assert.Equal(result.Container, expectedResult.Container);
Assert.Equal(result.Name, expectedResult.Name);
Assert.Equal(result.Year, expectedResult.Year);
Assert.Equal(result.ExtraType, expectedResult.ExtraType);
Assert.Equal(result.Format3D, expectedResult.Format3D);
Assert.Equal(result.Is3D, expectedResult.Is3D);
Assert.Equal(result.IsStub, expectedResult.IsStub);
Assert.Equal(result.StubType, expectedResult.StubType);
Assert.Equal(result.IsDirectory, expectedResult.IsDirectory);
Assert.Equal(result.FileNameWithoutExtension, expectedResult.FileNameWithoutExtension);
Assert.Equal(result?.Path, expectedResult.Path);
Assert.Equal(result?.Container, expectedResult.Container);
Assert.Equal(result?.Name, expectedResult.Name);
Assert.Equal(result?.Year, expectedResult.Year);
Assert.Equal(result?.ExtraType, expectedResult.ExtraType);
Assert.Equal(result?.Format3D, expectedResult.Format3D);
Assert.Equal(result?.Is3D, expectedResult.Is3D);
Assert.Equal(result?.IsStub, expectedResult.IsStub);
Assert.Equal(result?.StubType, expectedResult.StubType);
Assert.Equal(result?.IsDirectory, expectedResult.IsDirectory);
Assert.Equal(result?.FileNameWithoutExtension, expectedResult.FileNameWithoutExtension);
}
}
}

Loading…
Cancel
Save