From 25f6f3ec6d1c08d36eaf844ba8d70c9a663e55af Mon Sep 17 00:00:00 2001 From: Stepan Goremykin Date: Sat, 18 Mar 2023 23:05:46 +0100 Subject: [PATCH] Update FluentAssertions (cherry picked from commit 951a9ade00d7c9105f03608cb598450d706b826f) --- .../DirectoryLookupServiceFixture.cs | 4 +- .../DiskTests/DiskTransferServiceFixture.cs | 12 +-- .../TPLTests/RateLimitServiceFixture.cs | 2 +- .../Datastore/BasicRepositoryFixture.cs | 3 +- .../159_add_webrip_qualitiesFixture.cs | 18 ++--- .../FixFutureRunScheduledTasksFixture.cs | 2 +- .../ParserTests/LanguageParserFixture.cs | 78 +++++++++---------- .../ProviderStatusServiceFixture.cs | 7 +- .../Radarr.Test.Common.csproj | 2 +- 9 files changed, 65 insertions(+), 63 deletions(-) diff --git a/src/NzbDrone.Common.Test/DiskTests/DirectoryLookupServiceFixture.cs b/src/NzbDrone.Common.Test/DiskTests/DirectoryLookupServiceFixture.cs index 1dc4256ee..dd27f6f1b 100644 --- a/src/NzbDrone.Common.Test/DiskTests/DirectoryLookupServiceFixture.cs +++ b/src/NzbDrone.Common.Test/DiskTests/DirectoryLookupServiceFixture.cs @@ -49,7 +49,7 @@ namespace NzbDrone.Common.Test.DiskTests .Setup(s => s.GetDirectoryInfos(It.IsAny())) .Returns(_folders); - Subject.LookupContents(root, false, false).Directories.Should().NotContain(Path.Combine(root, RECYCLING_BIN)); + Subject.LookupContents(root, false, false).Directories.Should().NotContain(dir => dir.Path == Path.Combine(root, RECYCLING_BIN)); } [Test] @@ -62,7 +62,7 @@ namespace NzbDrone.Common.Test.DiskTests .Setup(s => s.GetDirectoryInfos(It.IsAny())) .Returns(_folders); - Subject.LookupContents(root, false, false).Directories.Should().NotContain(Path.Combine(root, SYSTEM_VOLUME_INFORMATION)); + Subject.LookupContents(root, false, false).Directories.Should().NotContain(dir => dir.Path == Path.Combine(root, SYSTEM_VOLUME_INFORMATION)); } [Test] diff --git a/src/NzbDrone.Common.Test/DiskTests/DiskTransferServiceFixture.cs b/src/NzbDrone.Common.Test/DiskTests/DiskTransferServiceFixture.cs index 8da3642be..04c5cb40a 100644 --- a/src/NzbDrone.Common.Test/DiskTests/DiskTransferServiceFixture.cs +++ b/src/NzbDrone.Common.Test/DiskTests/DiskTransferServiceFixture.cs @@ -564,7 +564,7 @@ namespace NzbDrone.Common.Test.DiskTests var count = Subject.MirrorFolder(source.FullName, destination.FullName); - count.Should().Equals(0); + count.Should().Be(0); destination.GetFileSystemInfos().Should().BeEmpty(); } @@ -584,7 +584,7 @@ namespace NzbDrone.Common.Test.DiskTests var count = Subject.MirrorFolder(source.FullName, destination.FullName); - count.Should().Equals(0); + count.Should().Be(0); destination.GetFileSystemInfos().Should().HaveCount(1); } @@ -601,7 +601,7 @@ namespace NzbDrone.Common.Test.DiskTests var count = Subject.MirrorFolder(source.FullName, destination.FullName); - count.Should().Equals(3); + count.Should().Be(3); VerifyCopyFolder(original.FullName, destination.FullName); } @@ -618,7 +618,7 @@ namespace NzbDrone.Common.Test.DiskTests var count = Subject.MirrorFolder(source.FullName, destination.FullName); - count.Should().Equals(3); + count.Should().Be(3); File.Exists(Path.Combine(destination.FullName, _nfsFile)).Should().BeFalse(); } @@ -638,7 +638,7 @@ namespace NzbDrone.Common.Test.DiskTests var count = Subject.MirrorFolder(source.FullName, destination.FullName); - count.Should().Equals(0); + count.Should().Be(0); VerifyCopyFolder(original.FullName, destination.FullName); } @@ -655,7 +655,7 @@ namespace NzbDrone.Common.Test.DiskTests var count = Subject.MirrorFolder(source.FullName + Path.DirectorySeparatorChar, destination.FullName); - count.Should().Equals(3); + count.Should().Be(3); VerifyCopyFolder(original.FullName, destination.FullName); } diff --git a/src/NzbDrone.Common.Test/TPLTests/RateLimitServiceFixture.cs b/src/NzbDrone.Common.Test/TPLTests/RateLimitServiceFixture.cs index a92eed1f1..1c6b5cb3d 100644 --- a/src/NzbDrone.Common.Test/TPLTests/RateLimitServiceFixture.cs +++ b/src/NzbDrone.Common.Test/TPLTests/RateLimitServiceFixture.cs @@ -120,7 +120,7 @@ namespace NzbDrone.Common.Test.TPLTests Subject.WaitAndPulse("me", "sub", TimeSpan.FromMilliseconds(100)); - (GetRateLimitStore()["me"] - _epoch).Should().BeCloseTo(TimeSpan.FromMilliseconds(200)); + (GetRateLimitStore()["me"] - _epoch).Should().BeCloseTo(TimeSpan.FromMilliseconds(200), TimeSpan.FromMilliseconds(20)); } } } diff --git a/src/NzbDrone.Core.Test/Datastore/BasicRepositoryFixture.cs b/src/NzbDrone.Core.Test/Datastore/BasicRepositoryFixture.cs index 8070f9fda..fac7e7f00 100644 --- a/src/NzbDrone.Core.Test/Datastore/BasicRepositoryFixture.cs +++ b/src/NzbDrone.Core.Test/Datastore/BasicRepositoryFixture.cs @@ -13,6 +13,7 @@ namespace NzbDrone.Core.Test.Datastore [TestFixture] public class BasicRepositoryFixture : DbTest, ScheduledTask> { + private readonly TimeSpan _dateTimePrecision = TimeSpan.FromMilliseconds(20); private List _basicList; [SetUp] @@ -20,7 +21,7 @@ namespace NzbDrone.Core.Test.Datastore { AssertionOptions.AssertEquivalencyUsing(options => { - options.Using(ctx => ctx.Subject.Should().BeCloseTo(ctx.Expectation.ToUniversalTime())).WhenTypeIs(); + options.Using(ctx => ctx.Subject.Should().BeCloseTo(ctx.Expectation.ToUniversalTime(), _dateTimePrecision)).WhenTypeIs(); return options; }); diff --git a/src/NzbDrone.Core.Test/Datastore/Migration/159_add_webrip_qualitiesFixture.cs b/src/NzbDrone.Core.Test/Datastore/Migration/159_add_webrip_qualitiesFixture.cs index 92d04e225..c844df509 100644 --- a/src/NzbDrone.Core.Test/Datastore/Migration/159_add_webrip_qualitiesFixture.cs +++ b/src/NzbDrone.Core.Test/Datastore/Migration/159_add_webrip_qualitiesFixture.cs @@ -38,9 +38,9 @@ namespace NzbDrone.Core.Test.Datastore.Migration var items = profiles.First().Items; items.Should().HaveCount(5); - items.Select(v => v.Quality).Should().BeEquivalentTo(1, null, null, null, null); - items.Select(v => v.Items.Count).Should().BeEquivalentTo(0, 2, 2, 2, 2); - items.Select(v => v.Allowed).Should().BeEquivalentTo(true, false, false, false, false); + items.Select(v => v.Quality).Should().Equal(1, null, null, null, null); + items.Select(v => v.Items.Count).Should().Equal(0, 2, 2, 2, 2); + items.Select(v => v.Allowed).Should().Equal(true, false, false, false, false); } [Test] @@ -61,9 +61,9 @@ namespace NzbDrone.Core.Test.Datastore.Migration var items = profiles.First().Items; items.Should().HaveCount(5); - items.Select(v => v.Quality).Should().BeEquivalentTo(1, null, null, null, null); - items.Select(v => v.Items.Count).Should().BeEquivalentTo(0, 2, 2, 2, 2); - items.Select(v => v.Allowed).Should().BeEquivalentTo(true, false, false, false, false); + items.Select(v => v.Quality).Should().Equal(1, null, null, null, null); + items.Select(v => v.Items.Count).Should().Equal(0, 2, 2, 2, 2); + items.Select(v => v.Allowed).Should().Equal(true, false, false, false, false); } [Test] @@ -85,9 +85,9 @@ namespace NzbDrone.Core.Test.Datastore.Migration var items = profiles.First().Items; items.Count(c => c.Id == 1001).Should().Be(1); items.Should().HaveCount(5); - items.Select(v => v.Quality).Should().BeEquivalentTo(1, null, null, null, null); - items.Select(v => v.Items.Count).Should().BeEquivalentTo(0, 2, 2, 2, 2); - items.Select(v => v.Allowed).Should().BeEquivalentTo(true, false, false, false, false); + items.Select(v => v.Quality).Should().Equal(1, null, null, null, null); + items.Select(v => v.Items.Count).Should().Equal(0, 2, 2, 2, 2); + items.Select(v => v.Allowed).Should().Equal(true, false, false, false, false); } [Test] diff --git a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/FixFutureRunScheduledTasksFixture.cs b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/FixFutureRunScheduledTasksFixture.cs index ce7df27b7..d1d9b35ba 100644 --- a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/FixFutureRunScheduledTasksFixture.cs +++ b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/FixFutureRunScheduledTasksFixture.cs @@ -42,7 +42,7 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers Subject.Clean(); // BeCloseTo handles Postgres rounding times - AllStoredModels.ToList().ForEach(t => t.LastExecution.Should().BeCloseTo(expectedTime)); + AllStoredModels.ToList().ForEach(t => t.LastExecution.Should().BeCloseTo(expectedTime, TimeSpan.FromMilliseconds(20))); } } } diff --git a/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs index a4d141f7b..b5cb6b1c8 100644 --- a/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs @@ -15,7 +15,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.English); + result.Languages.Should().Contain(Language.English); } [TestCase("The Danish Movie 2015")] @@ -25,7 +25,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Unknown); + result.Languages.Should().Contain(Language.Unknown); } [TestCase("Movie Title - 2022.en.sub")] @@ -54,7 +54,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.French); + result.Languages.Should().Contain(Language.French); } [TestCase("Movie 1990 1080p Eng Fra [mkvonly]")] @@ -78,7 +78,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Spanish); + result.Languages.Should().Contain(Language.Spanish); } [TestCase("Movie.Title.1994.German.1080p.XviD-LOL")] @@ -87,7 +87,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.German); + result.Languages.Should().Contain(Language.German); } [TestCase("Movie.Title.1994.Italian.1080p.XviD-LOL")] @@ -95,7 +95,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Italian); + result.Languages.Should().Contain(Language.Italian); } [TestCase("Movie.Title.1994.Danish.1080p.XviD-LOL")] @@ -103,7 +103,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Danish); + result.Languages.Should().Contain(Language.Danish); } [TestCase("Movie.Title.1994.Dutch.1080p.XviD-LOL")] @@ -111,7 +111,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Dutch); + result.Languages.Should().Contain(Language.Dutch); } [TestCase("Movie.Title.1994.Japanese.1080p.XviD-LOL")] @@ -119,7 +119,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Japanese); + result.Languages.Should().Contain(Language.Japanese); } [TestCase("Movie.Title.1994.Icelandic.1080p.XviD-LOL")] @@ -127,7 +127,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Icelandic); + result.Languages.Should().Contain(Language.Icelandic); } [TestCase("Movie.Title.1994.Chinese.1080p.XviD-LOL")] @@ -135,7 +135,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Chinese); + result.Languages.Should().Contain(Language.Chinese); } [TestCase("Movie.Title.1994.Russian.1080p.XviD-LOL")] @@ -143,7 +143,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Russian); + result.Languages.Should().Contain(Language.Russian); } [TestCase("Movie.Title.1994.Romanian.1080p.XviD-LOL")] @@ -152,7 +152,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Romanian); + result.Languages.Should().Contain(Language.Romanian); } [TestCase("Movie.Title.1994.Hindi.1080p.XviD-LOL")] @@ -160,7 +160,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Hindi); + result.Languages.Should().Contain(Language.Hindi); } [TestCase("Movie.Title.1994.Thai.1080p.XviD-LOL")] @@ -168,7 +168,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Thai); + result.Languages.Should().Contain(Language.Thai); } [TestCase("Movie.Title.1994.Bulgarian.1080p.XviD-LOL")] @@ -178,7 +178,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Bulgarian); + result.Languages.Should().Contain(Language.Bulgarian); } [TestCase("Movie.Title.1994.Dublado.1080p.XviD-LOL")] @@ -188,7 +188,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.PortugueseBR); + result.Languages.Should().Contain(Language.PortugueseBR); } [TestCase("Movie.Title.1994.Polish.1080p.XviD-LOL")] @@ -204,7 +204,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Polish); + result.Languages.Should().Contain(Language.Polish); } [TestCase("Movie.Title.1994.PL-SUB.1080p.XviD-LOL")] @@ -214,7 +214,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Unknown); + result.Languages.Should().Contain(Language.Unknown); } [TestCase("Movie.Title.1994.Vietnamese.1080p.XviD-LOL")] @@ -222,7 +222,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Vietnamese); + result.Languages.Should().Contain(Language.Vietnamese); } [TestCase("Movie.Title.1994.Swedish.1080p.XviD-LOL")] @@ -230,7 +230,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Swedish); + result.Languages.Should().Contain(Language.Swedish); } [TestCase("Movie.Title.1994.Norwegian.1080p.XviD-LOL")] @@ -238,7 +238,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Norwegian); + result.Languages.Should().Contain(Language.Norwegian); } [TestCase("Movie.Title.1994.Finnish.1080p.XviD-LOL")] @@ -246,7 +246,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Finnish); + result.Languages.Should().Contain(Language.Finnish); } [TestCase("Movie.Title.1994.Turkish.1080p.XviD-LOL")] @@ -254,7 +254,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Turkish); + result.Languages.Should().Contain(Language.Turkish); } [TestCase("Movie.Title.1994.Portuguese.1080p.XviD-LOL")] @@ -262,7 +262,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Portuguese); + result.Languages.Should().Contain(Language.Portuguese); } [TestCase("Movie.Title.1994.Flemish.1080p.XviD-LOL")] @@ -270,7 +270,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Flemish); + result.Languages.Should().Contain(Language.Flemish); } [TestCase("Movie.Title.1994.Greek.1080p.XviD-LOL")] @@ -278,7 +278,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Greek); + result.Languages.Should().Contain(Language.Greek); } [TestCase("Movie.Title.1994.Korean.1080p.XviD-LOL")] @@ -286,7 +286,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Korean); + result.Languages.Should().Contain(Language.Korean); } [TestCase("Movie.Title.1994.Hungarian.1080p.XviD-LOL")] @@ -294,7 +294,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Hungarian); + result.Languages.Should().Contain(Language.Hungarian); } [TestCase("Movie.Title.1994.Hebrew.1080p.XviD-LOL")] @@ -302,7 +302,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Hebrew); + result.Languages.Should().Contain(Language.Hebrew); } [TestCase("Movie.Title.1994.AC3.LT.EN-CNN")] @@ -310,7 +310,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Lithuanian); + result.Languages.Should().Contain(Language.Lithuanian); } [TestCase("Movie.Title.1994.CZ.1080p.XviD-LOL")] @@ -318,14 +318,14 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Czech); + result.Languages.Should().Contain(Language.Czech); } [TestCase("Movie.Title.2019.ARABIC.WEBRip.x264-VXT")] public void should_parse_language_arabic(string postTitle) { var result = Parser.Parser.ParseMovieTitle(postTitle); - result.Languages.Should().BeEquivalentTo(Language.Arabic); + result.Languages.Should().Contain(Language.Arabic); } [TestCase("Movie.Title [1989, BDRip] MVO + DVO + UKR (MVO) + Sub")] @@ -336,7 +336,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Ukrainian); + result.Languages.Should().Contain(Language.Ukrainian); } [TestCase("Movie.Title [1937, BDRip 1080p] Dub UKR/Eng + Sub rus")] @@ -352,14 +352,14 @@ namespace NzbDrone.Core.Test.ParserTests public void should_parse_language_persian(string postTitle) { var result = Parser.Parser.ParseMovieTitle(postTitle); - result.Languages.Should().BeEquivalentTo(Language.Persian); + result.Languages.Should().Contain(Language.Persian); } [TestCase("Movie.Title.2019.BENGALI.WEBRip.x264-VXT")] public void should_parse_language_bengali(string postTitle) { var result = Parser.Parser.ParseMovieTitle(postTitle); - result.Languages.Should().BeEquivalentTo(Language.Bengali); + result.Languages.Should().Contain(Language.Bengali); } [TestCase("Movie Title (2018) Telugu DVDScr X264 AAC 700 MB")] @@ -378,7 +378,7 @@ namespace NzbDrone.Core.Test.ParserTests public void should_parse_language_slovak(string postTitle) { var result = Parser.Parser.ParseMovieTitle(postTitle); - result.Languages.Should().BeEquivalentTo(Language.Slovak); + result.Languages.Should().Contain(Language.Slovak); } [TestCase("Movie.Title.2022.LV.WEBRip.XviD-LOL")] @@ -388,7 +388,7 @@ namespace NzbDrone.Core.Test.ParserTests public void should_parse_language_latvian(string postTitle) { var result = Parser.Parser.ParseMovieTitle(postTitle); - result.Languages.Should().BeEquivalentTo(Language.Latvian); + result.Languages.Should().Contain(Language.Latvian); } [TestCase("Movie.Title.2019.720p_Eng-Spa(Latino)_MovieClubMx")] @@ -408,7 +408,7 @@ namespace NzbDrone.Core.Test.ParserTests { var result = Parser.Parser.ParseMovieTitle(postTitle, true); - result.Languages.Should().BeEquivalentTo(Language.Catalan); + result.Languages.Should().Contain(Language.Catalan); } [TestCase("Movie.Title.en.sub")] diff --git a/src/NzbDrone.Core.Test/ThingiProviderTests/ProviderStatusServiceFixture.cs b/src/NzbDrone.Core.Test/ThingiProviderTests/ProviderStatusServiceFixture.cs index f9c0d4325..569544e86 100644 --- a/src/NzbDrone.Core.Test/ThingiProviderTests/ProviderStatusServiceFixture.cs +++ b/src/NzbDrone.Core.Test/ThingiProviderTests/ProviderStatusServiceFixture.cs @@ -34,6 +34,7 @@ namespace NzbDrone.Core.Test.ThingiProviderTests public class ProviderStatusServiceFixture : CoreTest { + private readonly TimeSpan _disabledTillPrecision = TimeSpan.FromMilliseconds(500); private DateTime _epoch; [SetUp] @@ -90,7 +91,7 @@ namespace NzbDrone.Core.Test.ThingiProviderTests var status = Subject.GetBlockedProviders().FirstOrDefault(); status.Should().NotBeNull(); status.DisabledTill.Should().HaveValue(); - status.DisabledTill.Value.Should().BeCloseTo(_epoch + TimeSpan.FromMinutes(5), 500); + status.DisabledTill.Value.Should().BeCloseTo(_epoch + TimeSpan.FromMinutes(5), _disabledTillPrecision); } [Test] @@ -133,7 +134,7 @@ namespace NzbDrone.Core.Test.ThingiProviderTests var status = Subject.GetBlockedProviders().FirstOrDefault(); status.Should().NotBeNull(); status.DisabledTill.Should().HaveValue(); - status.DisabledTill.Value.Should().BeCloseTo(_epoch + TimeSpan.FromMinutes(15), 500); + status.DisabledTill.Value.Should().BeCloseTo(_epoch + TimeSpan.FromMinutes(15), _disabledTillPrecision); } [Test] @@ -160,7 +161,7 @@ namespace NzbDrone.Core.Test.ThingiProviderTests status.Should().NotBeNull(); origStatus.EscalationLevel.Should().Be(3); - status.DisabledTill.Should().BeCloseTo(_epoch + TimeSpan.FromMinutes(5), 500); + status.DisabledTill.Should().BeCloseTo(_epoch + TimeSpan.FromMinutes(5), _disabledTillPrecision); } } } diff --git a/src/NzbDrone.Test.Common/Radarr.Test.Common.csproj b/src/NzbDrone.Test.Common/Radarr.Test.Common.csproj index 20f58ba43..4cc7c9f82 100644 --- a/src/NzbDrone.Test.Common/Radarr.Test.Common.csproj +++ b/src/NzbDrone.Test.Common/Radarr.Test.Common.csproj @@ -3,7 +3,7 @@ net6.0 - +