فهرست منبع

Fix failing unit tests on machines where the local timezone offset is far enough away from the test data day to be off by a day.

Change the test startdate to specifically be utc instead of local machine timezone.
Shane Powell 6 روز پیش
والد
کامیت
3330465337
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      tests/Jellyfin.LiveTv.Tests/Listings/XmlTvListingsProviderTests.cs

+ 2 - 2
tests/Jellyfin.LiveTv.Tests/Listings/XmlTvListingsProviderTests.cs

@@ -54,7 +54,7 @@ public class XmlTvListingsProviderTests
             Path = path
         };
 
-        var startDate = new DateTime(2022, 11, 4);
+        var startDate = new DateTime(2022, 11, 4, 0, 0, 0, 0, DateTimeKind.Utc);
         var programs = await _xmlTvListingsProvider.GetProgramsAsync(info, "3297", startDate, startDate.AddDays(1), CancellationToken.None);
         var programsList = programs.ToList();
         Assert.Single(programsList);
@@ -78,7 +78,7 @@ public class XmlTvListingsProviderTests
             Path = path
         };
 
-        var startDate = new DateTime(2022, 11, 4);
+        var startDate = new DateTime(2022, 11, 4, 0, 0, 0, DateTimeKind.Utc);
         var programs = await _xmlTvListingsProvider.GetProgramsAsync(info, "3297", startDate, startDate.AddDays(1), CancellationToken.None);
         var programsList = programs.ToList();
         Assert.Single(programsList);