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.
This commit is contained in:
Shane Powell 2025-05-31 10:41:26 +12:00
parent 4ba95b9ac4
commit 3330465337

View File

@ -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);