Skip to content

Commit 7201040

Browse files
author
Bart Koelman
committed
Package updates
1 parent 71a9700 commit 7201040

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121

2222
<!-- Test Project Dependencies -->
2323
<PropertyGroup>
24-
<BogusVersion>33.0.2</BogusVersion>
24+
<BogusVersion>33.1.1</BogusVersion>
2525
<CoverletVersion>3.1.0</CoverletVersion>
26-
<FluentAssertionsVersion>5.10.3</FluentAssertionsVersion>
26+
<FluentAssertionsVersion>6.1.0</FluentAssertionsVersion>
2727
<MoqVersion>4.16.1</MoqVersion>
2828
<XUnitVersion>2.4.*</XUnitVersion>
29-
<TestSdkVersion>16.10.0</TestSdkVersion>
29+
<TestSdkVersion>16.11.0</TestSdkVersion>
3030
</PropertyGroup>
3131
</Project>

test/TestBuildingBlocks/HttpResponseMessageExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public sealed class HttpResponseMessageAssertions : ReferenceTypeAssertions<Http
1919
protected override string Identifier => "response";
2020

2121
public HttpResponseMessageAssertions(HttpResponseMessage instance)
22+
: base(instance)
2223
{
23-
Subject = instance;
2424
}
2525

2626
// ReSharper disable once UnusedMethodReturnValue.Global

test/TestBuildingBlocks/ObjectAssertionsExtensions.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace TestBuildingBlocks
1212
public static class ObjectAssertionsExtensions
1313
{
1414
private const decimal NumericPrecision = 0.00000000001M;
15+
private static readonly TimeSpan TimePrecision = TimeSpan.FromMilliseconds(20);
1516

1617
private static readonly JsonWriterOptions JsonWriterOptions = new()
1718
{
@@ -38,10 +39,21 @@ public static void BeCloseTo(this ObjectAssertions source, DateTimeOffset? expec
3839
}
3940

4041
// We lose a little bit of precision (milliseconds) on roundtrip through PostgreSQL database.
41-
value.Should().BeCloseTo(expected.Value, because: because, becauseArgs: becauseArgs);
42+
value.Should().BeCloseTo(expected.Value, TimePrecision, because, becauseArgs);
4243
}
4344
}
4445

46+
/// <summary>
47+
/// Same as <see cref="DateTimeOffsetAssertions{TAssertions}.BeCloseTo(DateTimeOffset, TimeSpan, string, object[])" />, but with default precision.
48+
/// </summary>
49+
[CustomAssertion]
50+
public static AndConstraint<TAssertions> BeCloseTo<TAssertions>(this DateTimeOffsetAssertions<TAssertions> parent, DateTimeOffset nearbyTime,
51+
string because = "", params object[] becauseArgs)
52+
where TAssertions : DateTimeOffsetAssertions<TAssertions>
53+
{
54+
return parent.BeCloseTo(nearbyTime, TimePrecision, because, becauseArgs);
55+
}
56+
4557
/// <summary>
4658
/// Same as <see cref="NumericAssertionsExtensions.BeApproximately(NumericAssertions{decimal}, decimal, decimal, string, object[])" />, but with default
4759
/// precision.

0 commit comments

Comments
 (0)