aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Directory.Packages.props2
-rw-r--r--tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs10
-rw-r--r--tests/Jellyfin.Server.Tests/UrlDecodeQueryFeatureTests.cs2
-rw-r--r--tests/jellyfin-tests.ruleset6
4 files changed, 13 insertions, 7 deletions
diff --git a/Directory.Packages.props b/Directory.Packages.props
index ff8b42f75..6b9b51826 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -87,6 +87,6 @@
<PackageVersion Include="Xunit.Priority" Version="1.1.6" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.0" />
<PackageVersion Include="Xunit.SkippableFact" Version="1.4.13" />
- <PackageVersion Include="xunit" Version="2.4.2" />
+ <PackageVersion Include="xunit" Version="2.5.0" />
</ItemGroup>
</Project>
diff --git a/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs b/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs
index e1d2bb2d5..d4f28f327 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs
+++ b/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs
@@ -96,7 +96,7 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv.SchedulesDirect
var days = JsonSerializer.Deserialize<IReadOnlyList<DayDto>>(bytes, _jsonOptions);
Assert.NotNull(days);
- Assert.Equal(1, days!.Count);
+ Assert.Single(days);
var dayDto = days[0];
Assert.Equal("20454", dayDto.StationId);
@@ -110,7 +110,7 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv.SchedulesDirect
Assert.Equal(2, dayDto.Programs[0].AudioProperties.Count);
Assert.Equal("stereo", dayDto.Programs[0].AudioProperties[0]);
Assert.Equal("cc", dayDto.Programs[0].AudioProperties[1]);
- Assert.Equal(1, dayDto.Programs[0].VideoProperties.Count);
+ Assert.Single(dayDto.Programs[0].VideoProperties);
Assert.Equal("hdtv", dayDto.Programs[0].VideoProperties[0]);
}
@@ -126,13 +126,13 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv.SchedulesDirect
Assert.NotNull(programDtos);
Assert.Equal(2, programDtos!.Count);
Assert.Equal("EP000000060003", programDtos[0].ProgramId);
- Assert.Equal(1, programDtos[0].Titles.Count);
+ Assert.Single(programDtos[0].Titles);
Assert.Equal("'Allo 'Allo!", programDtos[0].Titles[0].Title120);
Assert.Equal("Series", programDtos[0].EventDetails?.SubType);
Assert.Equal("en", programDtos[0].Descriptions?.Description1000[0].DescriptionLanguage);
Assert.Equal("A disguised British Intelligence officer is sent to help the airmen.", programDtos[0].Descriptions?.Description1000[0].Description);
Assert.Equal(new DateTime(1985, 11, 04), programDtos[0].OriginalAirDate);
- Assert.Equal(1, programDtos[0].Genres.Count);
+ Assert.Single(programDtos[0].Genres);
Assert.Equal("Sitcom", programDtos[0].Genres[0]);
Assert.Equal("The Poloceman Cometh", programDtos[0].EpisodeTitle150);
Assert.Equal(2, programDtos[0].Metadata[0].Gracenote?.Season);
@@ -161,7 +161,7 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv.SchedulesDirect
var showImagesDtos = JsonSerializer.Deserialize<IReadOnlyList<ShowImagesDto>>(bytes, _jsonOptions);
Assert.NotNull(showImagesDtos);
- Assert.Equal(1, showImagesDtos!.Count);
+ Assert.Single(showImagesDtos!);
Assert.Equal("SH00712240", showImagesDtos[0].ProgramId);
Assert.Equal(4, showImagesDtos[0].Data.Count);
Assert.Equal("135", showImagesDtos[0].Data[0].Width);
diff --git a/tests/Jellyfin.Server.Tests/UrlDecodeQueryFeatureTests.cs b/tests/Jellyfin.Server.Tests/UrlDecodeQueryFeatureTests.cs
index 797fc8f64..93e065685 100644
--- a/tests/Jellyfin.Server.Tests/UrlDecodeQueryFeatureTests.cs
+++ b/tests/Jellyfin.Server.Tests/UrlDecodeQueryFeatureTests.cs
@@ -22,7 +22,7 @@ namespace Jellyfin.Server.Tests
Assert.Single(test.Query);
var (k, v) = test.Query.First();
Assert.Equal(key, k);
- Assert.Empty(v);
+ Assert.True(StringValues.IsNullOrEmpty(v));
}
}
}
diff --git a/tests/jellyfin-tests.ruleset b/tests/jellyfin-tests.ruleset
index e2abaf5bb..9d133da56 100644
--- a/tests/jellyfin-tests.ruleset
+++ b/tests/jellyfin-tests.ruleset
@@ -19,4 +19,10 @@
<!-- CA2234: Pass system uri objects instead of strings -->
<Rule Id="CA2234" Action="Info" />
</Rules>
+
+ <!-- xUnit -->
+ <Rules AnalyzerId="xUnit" RuleNamespace="xUnit">
+ <!-- Test methods must have a supported return type. -->
+ <Rule Id="xUnit1028" Action="None" />
+ </Rules>
</RuleSet>