Update FluentAssertions

(cherry picked from commit 951a9ade00d7c9105f03608cb598450d706b826f)
pull/1822/head
Stepan Goremykin 2 years ago committed by Bogdan
parent 26afcb0071
commit 1e4c67dcdb

@ -49,7 +49,7 @@ namespace NzbDrone.Common.Test.DiskTests
.Setup(s => s.GetDirectoryInfos(It.IsAny<string>()))
.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<string>()))
.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]

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

@ -13,6 +13,7 @@ namespace NzbDrone.Core.Test.Datastore
[TestFixture]
public class BasicRepositoryFixture : DbTest<BasicRepository<ScheduledTask>, ScheduledTask>
{
private readonly TimeSpan _dateTimePrecision = TimeSpan.FromMilliseconds(20);
private List<ScheduledTask> _basicList;
[SetUp]
@ -20,7 +21,7 @@ namespace NzbDrone.Core.Test.Datastore
{
AssertionOptions.AssertEquivalencyUsing(options =>
{
options.Using<DateTime>(ctx => ctx.Subject.Should().BeCloseTo(ctx.Expectation.ToUniversalTime())).WhenTypeIs<DateTime>();
options.Using<DateTime>(ctx => ctx.Subject.Should().BeCloseTo(ctx.Expectation.ToUniversalTime(), _dateTimePrecision)).WhenTypeIs<DateTime>();
return options;
});

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

@ -34,6 +34,7 @@ namespace NzbDrone.Core.Test.ThingiProviderTests
public class ProviderStatusServiceFixture : CoreTest<MockProviderStatusService>
{
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(1), 500);
status.DisabledTill.Value.Should().BeCloseTo(_epoch + TimeSpan.FromMinutes(1), _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(5), 500);
status.DisabledTill.Value.Should().BeCloseTo(_epoch + TimeSpan.FromMinutes(5), _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(1), 500);
status.DisabledTill.Should().BeCloseTo(_epoch + TimeSpan.FromMinutes(1), _disabledTillPrecision);
}
}
}

@ -3,7 +3,7 @@
<TargetFrameworks>net6.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="FluentValidation" Version="9.5.4" />
<PackageReference Include="Moq" Version="4.17.2" />
<PackageReference Include="NLog" Version="5.2.0" />

Loading…
Cancel
Save