diff --git a/back/tests/Kyoo.Tests/Database/SpecificTests/EpisodeTests.cs b/back/tests/Kyoo.Tests/Database/SpecificTests/EpisodeTests.cs index 988ec0c3..c6f5d51e 100644 --- a/back/tests/Kyoo.Tests/Database/SpecificTests/EpisodeTests.cs +++ b/back/tests/Kyoo.Tests/Database/SpecificTests/EpisodeTests.cs @@ -16,6 +16,7 @@ // You should have received a copy of the GNU General Public License // along with Kyoo. If not, see . +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -284,6 +285,8 @@ namespace Kyoo.Tests.Database await _repository.Create(value); ICollection ret = await _repository.Search(query); value.Show = TestSample.Get(); + value.Show.AddedDate = DateTime.UnixEpoch; + ret.First().Show.AddedDate = DateTime.UnixEpoch; KAssert.DeepEqual(value, ret.First()); } diff --git a/back/tests/Kyoo.Tests/KAssert.cs b/back/tests/Kyoo.Tests/KAssert.cs index 585878fc..e0c43a99 100644 --- a/back/tests/Kyoo.Tests/KAssert.cs +++ b/back/tests/Kyoo.Tests/KAssert.cs @@ -16,6 +16,7 @@ // You should have received a copy of the GNU General Public License // along with Kyoo. If not, see . +using System; using FluentAssertions; using JetBrains.Annotations; using Kyoo.Abstractions.Models; @@ -37,7 +38,8 @@ namespace Kyoo.Tests [AssertionMethod] public static void DeepEqual(T expected, T value) { - if (expected is IResource res && expected is IThumbnails thumbs) { + if (expected is IResource res and IThumbnails thumbs) + { if (thumbs.Poster != null) thumbs.Poster.Path = $"/{expected.GetType().Name.ToLower()}/{res.Slug}/poster"; if (thumbs.Thumbnail != null) @@ -45,7 +47,8 @@ namespace Kyoo.Tests if (thumbs.Logo != null) thumbs.Logo.Path = $"/{expected.GetType().Name.ToLower()}/{res.Slug}/logo"; } - if (value is IResource resV && value is IThumbnails thumbsV) { + if (value is IResource resV and IThumbnails thumbsV) + { if (thumbsV.Poster != null) thumbsV.Poster.Path = $"/{value.GetType().Name.ToLower()}/{resV.Slug}/poster"; if (thumbsV.Thumbnail != null) @@ -53,6 +56,11 @@ namespace Kyoo.Tests if (thumbsV.Logo != null) thumbsV.Logo.Path = $"/{value.GetType().Name.ToLower()}/{resV.Slug}/logo"; } + if (expected is IAddedDate ea && value is IAddedDate va) + { + ea.AddedDate = DateTime.UnixEpoch; + va.AddedDate = DateTime.UnixEpoch; + } value.Should().BeEquivalentTo(expected); }