From 04973a489f0ed4ad9d65a7bb6fec0e03d00c6142 Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Fri, 3 Sep 2021 13:56:51 -0600 Subject: [PATCH] use JsonOptions --- .../SchedulesDirectDeserializeTests.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs b/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs index ab08e22ab1..a494d883ec 100644 --- a/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs +++ b/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs @@ -24,7 +24,7 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv.SchedulesDirect public void Deserialize_Token_Response_Live_Success() { var bytes = File.ReadAllBytes("Test Data/SchedulesDirect/token_live_response.json"); - var tokenDto = JsonSerializer.Deserialize(bytes); + var tokenDto = JsonSerializer.Deserialize(bytes, _jsonOptions); Assert.NotNull(tokenDto); Assert.Equal(0, tokenDto!.Code); @@ -41,7 +41,7 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv.SchedulesDirect public void Deserialize_Token_Response_Offline_Success() { var bytes = File.ReadAllBytes("Test Data/SchedulesDirect/token_offline_response.json"); - var tokenDto = JsonSerializer.Deserialize(bytes); + var tokenDto = JsonSerializer.Deserialize(bytes, _jsonOptions); Assert.NotNull(tokenDto); Assert.Equal(3_000, tokenDto!.Code); @@ -93,7 +93,7 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv.SchedulesDirect public void Deserialize_Schedule_Response_Success() { var bytes = File.ReadAllBytes("Test Data/SchedulesDirect/schedules_response.json"); - var days = JsonSerializer.Deserialize>(bytes); + var days = JsonSerializer.Deserialize>(bytes, _jsonOptions); Assert.NotNull(days); Assert.Equal(1, days!.Count); @@ -121,7 +121,7 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv.SchedulesDirect public void Deserialize_Program_Response_Success() { var bytes = File.ReadAllBytes("Test Data/SchedulesDirect/programs_response.json"); - var programDtos = JsonSerializer.Deserialize>(bytes); + var programDtos = JsonSerializer.Deserialize>(bytes, _jsonOptions); Assert.NotNull(programDtos); Assert.Equal(2, programDtos!.Count); @@ -158,7 +158,7 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv.SchedulesDirect public void Deserialize_Metadata_Programs_Response_Success() { var bytes = File.ReadAllBytes("Test Data/SchedulesDirect/metadata_programs_response.json"); - var showImagesDtos = JsonSerializer.Deserialize>(bytes); + var showImagesDtos = JsonSerializer.Deserialize>(bytes, _jsonOptions); Assert.NotNull(showImagesDtos); Assert.Equal(1, showImagesDtos!.Count); @@ -182,7 +182,7 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv.SchedulesDirect public void Deserialize_Headends_Response_Success() { var bytes = File.ReadAllBytes("Test Data/SchedulesDirect/headends_response.json"); - var headendsDtos = JsonSerializer.Deserialize>(bytes); + var headendsDtos = JsonSerializer.Deserialize>(bytes, _jsonOptions); Assert.NotNull(headendsDtos); Assert.Equal(8, headendsDtos!.Count); @@ -202,7 +202,7 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv.SchedulesDirect public void Deserialize_Lineups_Response_Success() { var bytes = File.ReadAllBytes("Test Data/SchedulesDirect/lineups_response.json"); - var lineupsDto = JsonSerializer.Deserialize(bytes); + var lineupsDto = JsonSerializer.Deserialize(bytes, _jsonOptions); Assert.NotNull(lineupsDto); Assert.Equal(0, lineupsDto!.Code); @@ -226,7 +226,7 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv.SchedulesDirect public void Deserialize_Lineup_Response_Success() { var bytes = File.ReadAllBytes("Test Data/SchedulesDirect/lineup_response.json"); - var channelDto = JsonSerializer.Deserialize(bytes); + var channelDto = JsonSerializer.Deserialize(bytes, _jsonOptions); Assert.NotNull(channelDto); Assert.Equal(2, channelDto!.Map.Count);