Skip to content

Commit 7a00e71

Browse files
Revert "Upgrade FluentAssertions to the version 8.0.0."
This reverts commit 2ddf6a6.
1 parent c8fc062 commit 7a00e71

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

Directory.Packages.props

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
55
<ItemGroup>
6-
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
7-
<PackageVersion Include="FluentAssertions" Version="8.0.0" />
6+
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
7+
<PackageVersion Include="FluentAssertions" Version="6.12.1" />
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" />
1110
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
1211
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.4" />
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" />
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" />
1716
<PackageVersion Include="Moq" Version="4.20.72" />
1817
<PackageVersion Include="PosInformatique.Moq.Analyzers" Version="1.11.0" />
19-
<PackageVersion Include="PosInformatique.FluentAssertions.Json" Version="1.5.0-rc.1" />
18+
<PackageVersion Include="PosInformatique.FluentAssertions.Json" Version="1.4.0" />
2019
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
21-
<PackageVersion Include="xunit" Version="2.9.3" />
22-
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.1" />
20+
<PackageVersion Include="xunit" Version="2.8.1" />
21+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1" />
2322
</ItemGroup>
2423
</Project>

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

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

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

5657
if (byteRead != -1)
5758
{
58-
AssertionEngine.TestFramework.Throw("The body of the response is not empty.");
59+
Services.ThrowException("The body of the response is not empty.");
5960
}
6061

6162
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;
9+
using global::FluentAssertions.Common;
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-
AssertionEngine.TestFramework.Throw("The response does not originate from a HttpRequestDataMock object.");
27+
Services.ThrowException("The response does not originate from a HttpRequestDataMock object.");
2828
return default!;
2929
}
3030

3131
if (!request.Mock.Responses.Contains(responseMock))
3232
{
33-
AssertionEngine.TestFramework.Throw("The response does not originate from the request instance.");
33+
Services.ThrowException("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 same string, but they differ at index 4:\r\n ↓ (actual)\r\n \"The other string\"\r\n \"The string\"\r\n ↑ (expected).");
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).");
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 same string, but they differ at index 0:\r\n ↓ (actual)\r\n \"\u2065瑯敨\u2072瑳楲杮\"\r\n \"The string\"\r\n ↑ (expected).");
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).");
216216

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

0 commit comments

Comments
 (0)