Skip to content

Commit c03b85d

Browse files
author
Bart Koelman
committed
Package updates
1 parent 742381d commit c03b85d

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
@@ -14,6 +14,7 @@ namespace TestBuildingBlocks
1414
public static class ObjectAssertionsExtensions
1515
{
1616
private const decimal NumericPrecision = 0.00000000001M;
17+
private static readonly TimeSpan TimePrecision = TimeSpan.FromMilliseconds(20);
1718

1819
private static readonly JsonWriterOptions JsonWriterOptions = new()
1920
{
@@ -40,10 +41,21 @@ public static void BeCloseTo(this ObjectAssertions source, DateTimeOffset? expec
4041
}
4142

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

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

0 commit comments

Comments
 (0)