Skip to content

Commit e037f93

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

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

Directory.Build.props

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
<EFCoreVersion>5.0.*</EFCoreVersion>
66
<NpgsqlPostgreSQLVersion>5.0.*</NpgsqlPostgreSQLVersion>
77
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
8+
<WarningLevel>9999</WarningLevel>
89
</PropertyGroup>
910

1011
<ItemGroup>
1112
<PackageReference Include="JetBrains.Annotations" Version="2021.1.0" PrivateAssets="All" />
12-
<PackageReference Include="CSharpGuidelinesAnalyzer" Version="3.6.0" PrivateAssets="All" />
13+
<PackageReference Include="CSharpGuidelinesAnalyzer" Version="3.7.0" PrivateAssets="All" />
1314
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CSharpGuidelinesAnalyzer.config" Visible="False" />
1415
</ItemGroup>
1516

@@ -21,11 +22,11 @@
2122

2223
<!-- Test Project Dependencies -->
2324
<PropertyGroup>
24-
<BogusVersion>33.0.2</BogusVersion>
25+
<BogusVersion>33.1.1</BogusVersion>
2526
<CoverletVersion>3.1.0</CoverletVersion>
26-
<FluentAssertionsVersion>5.10.3</FluentAssertionsVersion>
27+
<FluentAssertionsVersion>6.1.0</FluentAssertionsVersion>
2728
<MoqVersion>4.16.1</MoqVersion>
2829
<XUnitVersion>2.4.*</XUnitVersion>
29-
<TestSdkVersion>16.10.0</TestSdkVersion>
30+
<TestSdkVersion>16.11.0</TestSdkVersion>
3031
</PropertyGroup>
3132
</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)