Skip to content

Commit 2ddf6a6

Browse files
Upgrade FluentAssertions to the version 8.0.0.
1 parent 45a6b79 commit 2ddf6a6

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

Directory.Packages.props

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
55
<ItemGroup>
6-
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
7-
<PackageVersion Include="FluentAssertions" Version="6.12.1" />
6+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
7+
<PackageVersion Include="FluentAssertions" Version="8.0.0" />
88
<PackageVersion Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
99
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Core" Version="1.19.0" />
10+
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.2.0" />
1011
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
1112
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.4" />
12-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
13-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" Version="1.1.1" />
14-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.1" />
15-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
13+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.12.0" />
14+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" Version="1.1.2" />
15+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.2" />
16+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
1617
<PackageVersion Include="Moq" Version="4.20.72" />
1718
<PackageVersion Include="PosInformatique.Moq.Analyzers" Version="1.11.0" />
18-
<PackageVersion Include="PosInformatique.FluentAssertions.Json" Version="1.4.0" />
19+
<PackageVersion Include="PosInformatique.FluentAssertions.Json" Version="1.5.0-rc.1" />
1920
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
20-
<PackageVersion Include="xunit" Version="2.8.1" />
21-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1" />
21+
<PackageVersion Include="xunit" Version="2.9.3" />
22+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.1" />
2223
</ItemGroup>
2324
</Project>

src/Testing.Azure.Functions.Http/HttpResponseDataAssertions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ namespace PosInformatique.Testing.Azure.Functions.Http
99
using System.Text;
1010
using System.Text.Json;
1111
using global::FluentAssertions;
12-
using global::FluentAssertions.Common;
1312
using Microsoft.Azure.Functions.Worker.Http;
1413

1514
/// <summary>
@@ -56,7 +55,7 @@ public HttpResponseDataAssertions WithEmptyBody()
5655

5756
if (byteRead != -1)
5857
{
59-
Services.ThrowException("The body of the response is not empty.");
58+
AssertionEngine.TestFramework.Throw("The body of the response is not empty.");
6059
}
6160

6261
return this;

src/Testing.Azure.Functions.Http/HttpResponseDataAssertionsExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace PosInformatique.Testing.Azure.Functions.Http
88
{
9-
using global::FluentAssertions.Common;
9+
using global::FluentAssertions;
1010
using Microsoft.Azure.Functions.Worker.Http;
1111

1212
/// <summary>
@@ -24,13 +24,13 @@ public static HttpResponseDataAssertions ShouldMatchRequest(this HttpResponseDat
2424
{
2525
if (response is not HttpResponseDataImplementation responseMock)
2626
{
27-
Services.ThrowException("The response does not originate from a HttpRequestDataMock object.");
27+
AssertionEngine.TestFramework.Throw("The response does not originate from a HttpRequestDataMock object.");
2828
return default!;
2929
}
3030

3131
if (!request.Mock.Responses.Contains(responseMock))
3232
{
33-
Services.ThrowException("The response does not originate from the request instance.");
33+
AssertionEngine.TestFramework.Throw("The response does not originate from the request instance.");
3434
}
3535

3636
return new HttpResponseDataAssertions(responseMock);

tests/Testing.Azure.Functions.Http.Tests/HttpResponseDataAssertionsTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public void WithStringBody_DifferentValue_Failed()
191191
};
192192

193193
act.Should().ThrowExactly<XunitException>()
194-
.WithMessage("Expected actualString to be \"The string\" with a length of 10, but \"The other string\" has a length of 16, differs near \"oth\" (index 4).");
194+
.WithMessage("Expected actualString to be the same string, but they differ at index 4:\r\n ↓ (actual)\r\n \"The other string\"\r\n \"The string\"\r\n ↑ (expected).");
195195

196196
response.Body.Position.Should().Be(position);
197197
}
@@ -212,7 +212,7 @@ public void WithStringBody_DifferentEncoding_Failed()
212212
};
213213

214214
act.Should().ThrowExactly<XunitException>()
215-
.WithMessage("Expected actualString to be \"The string\" with a length of 10, but \"\u2065瑯敨\u2072瑳楲杮\" has a length of 8, differs near \"\u2065\" (index 0).");
215+
.WithMessage("Expected actualString to be the same string, but they differ at index 0:\r\n ↓ (actual)\r\n \"\u2065瑯敨\u2072瑳楲杮\"\r\n \"The string\"\r\n ↑ (expected).");
216216

217217
response.Body.Position.Should().Be(position);
218218
}

0 commit comments

Comments
 (0)