Skip to content

Commit 13b4aca

Browse files
authored
v3.9.0 (#87)
* Enable isolated functions. Integrate NUnit 4 upgrade. * IEquatable and testings. * Doco tweak. * Testing check, * CompositeKey and IEventDatFormatter * ReferenceDataMultiDictionaryConverterFactory * Code optimizations. * IsMapNullIfNull
1 parent 127bfa3 commit 13b4aca

File tree

235 files changed

+7622
-4672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+7622
-4672
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
Represents the **NuGet** versions.
44

5+
## v3.9.0
6+
- *Enhancement*: A new `Abstractions.ServiceBusMessageActions` has been created to encapsulate either a `Microsoft.Azure.WebJobs.ServiceBus.ServiceBusMessageActions` (existing [_in-process_](https://learn.microsoft.com/en-us/azure/azure-functions/functions-dotnet-class-library) function support) or `Microsoft.Azure.Functions.Worker.ServiceBusMessageActions` (new [_isolated_](https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide) function support) and used internally. Implicit conversion is enabled to simplify usage; existing projects will need to be recompiled. The latter capability does not support `RenewAsync` and as such this capability is no longer leveraged for consistency; review documented [`PeekLock`](https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus-trigger?tabs=python-v2%2Cisolated-process%2Cnodejs-v4%2Cextensionv5&pivots=programming-language-csharp#peeklock-behavior) behavior to get desired outcome.
7+
- *Enhancement*: The `Result`, `Result<T>`, `PagingArgs` and `PagingResult` have had `IEquatable` added to enable equality comparisons.
8+
- *Enhancement*: Upgraded `UnitTestEx` dependency to `4.0.2` to enable _isolated_ function testing.
9+
- *Enhancement*: Enabled `IJsonSerializer` support for `CompositeKey` JSON serialization/deserialization.
10+
- *Enhancement*: Added `IEventDataFormatter` which when implemented by the value set as the `EventData.Value` allows additional formatting to be applied by the `EventDataFormatter`.
11+
- *Enhancement*: Added `IsMapNullIfNull` to `BidirectionalMapper` that indicates whether to map `null` source value to a corresponding `null` destination automatically.
12+
- *Fixed*: Added `ReferenceDataMultiDictionaryConverterFactory` to ensure each `IReferenceDataCollection` is serialized correctly according to its underlying type.
13+
- *Fixed*: `EventDataFormatter` and `CloudEventSerializerBase` updated to correctly set the `Key` property where applicable.
14+
- *Internal:* Upgraded `NUnit` dependency to `4.0.1` for all `CoreEx` unit test; also, all unit tests now leverage the [_NUnit constraint model_](https://docs.nunit.org/articles/nunit/writing-tests/assertions/assertion-models/constraint.html) testing approach.
15+
516
## v3.8.1
617
- *Fixed*: The `CoreEx.Text.JsonSerializer` has been updated to cache the _indented_ option correctly.
718
- *Fixed*: The `ReferenceDataOrchestator` updated to use the correct serializer for `ETag` generation.

Common.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>3.8.1</Version>
3+
<Version>3.9.0</Version>
44
<LangVersion>preview</LangVersion>
55
<Authors>Avanade</Authors>
66
<Company>Avanade</Company>

CoreEx.sln

+14
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreEx.UnitTesting", "src\C
8383
EndProject
8484
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreEx.UnitTesting.NUnit", "src\CoreEx.UnitTesting.NUnit\CoreEx.UnitTesting.NUnit.csproj", "{91910971-4B1A-4791-9BB4-65FAB3ED3C76}"
8585
EndProject
86+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreEx.TestFunctionIso", "tests\CoreEx.TestFunctionIso\CoreEx.TestFunctionIso.csproj", "{6F7B4F1E-3C3A-4CD7-A9BF-973A5053C1C8}"
87+
EndProject
88+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreEx.Test2", "tests\CoreEx.Test2\CoreEx.Test2.csproj", "{910B5894-46BC-4427-95D6-2804F06458E3}"
89+
EndProject
8690
Global
8791
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8892
Debug|Any CPU = Debug|Any CPU
@@ -197,6 +201,14 @@ Global
197201
{91910971-4B1A-4791-9BB4-65FAB3ED3C76}.Debug|Any CPU.Build.0 = Debug|Any CPU
198202
{91910971-4B1A-4791-9BB4-65FAB3ED3C76}.Release|Any CPU.ActiveCfg = Release|Any CPU
199203
{91910971-4B1A-4791-9BB4-65FAB3ED3C76}.Release|Any CPU.Build.0 = Release|Any CPU
204+
{6F7B4F1E-3C3A-4CD7-A9BF-973A5053C1C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
205+
{6F7B4F1E-3C3A-4CD7-A9BF-973A5053C1C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
206+
{6F7B4F1E-3C3A-4CD7-A9BF-973A5053C1C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
207+
{6F7B4F1E-3C3A-4CD7-A9BF-973A5053C1C8}.Release|Any CPU.Build.0 = Release|Any CPU
208+
{910B5894-46BC-4427-95D6-2804F06458E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
209+
{910B5894-46BC-4427-95D6-2804F06458E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
210+
{910B5894-46BC-4427-95D6-2804F06458E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
211+
{910B5894-46BC-4427-95D6-2804F06458E3}.Release|Any CPU.Build.0 = Release|Any CPU
200212
EndGlobalSection
201213
GlobalSection(SolutionProperties) = preSolution
202214
HideSolutionNode = FALSE
@@ -231,6 +243,8 @@ Global
231243
{D2C61D4A-2A6D-4284-BF9D-09F51BA735B8} = {4B6BC31E-93B1-42B0-AE09-AD85AC4DB657}
232244
{AC247FD3-5F9F-4DD2-B0CB-1C9CD1EB98D2} = {D2C61D4A-2A6D-4284-BF9D-09F51BA735B8}
233245
{91910971-4B1A-4791-9BB4-65FAB3ED3C76} = {D2C61D4A-2A6D-4284-BF9D-09F51BA735B8}
246+
{6F7B4F1E-3C3A-4CD7-A9BF-973A5053C1C8} = {3145DCB9-98FB-4519-BCC0-75A22A252EDC}
247+
{910B5894-46BC-4427-95D6-2804F06458E3} = {3145DCB9-98FB-4519-BCC0-75A22A252EDC}
234248
EndGlobalSection
235249
GlobalSection(ExtensibilityGlobals) = postSolution
236250
SolutionGuid = {8B4566D2-9B22-4E27-9654-402BDBA6C744}

samples/My.Hr/My.Hr.Business/My.Hr.Business.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
</ItemGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.18" />
21-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.18" />
20+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.26" />
21+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.26" />
2222
</ItemGroup>
2323

2424
</Project>

samples/My.Hr/My.Hr.Database/My.Hr.Database.csproj

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<PackageReference Include="DbEx.SqlServer" Version="2.3.14" />
25-
<PackageReference Include="Microsoft.Tye.Extensions.Configuration" Version="0.10.0-alpha.21420.1" />
24+
<PackageReference Include="DbEx.SqlServer" Version="2.3.15" />
2625
</ItemGroup>
2726

2827
<ItemGroup>

samples/My.Hr/My.Hr.UnitTest/EmployeeControllerTest.cs

+11-11
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ public void B100_GetAll_All()
103103
.AssertOK()
104104
.GetValue<EmployeeCollectionResult>();
105105

106-
Assert.IsNotNull(v?.Items);
107-
Assert.AreEqual(4, v!.Items.Count);
108-
Assert.AreEqual(new string[] { "Browne", "Jones", "Smith", "Smithers" }, v.Items.Select(x => x.LastName).ToArray());
106+
Assert.That(v?.Items, Is.Not.Null);
107+
Assert.That(v!.Items, Has.Count.EqualTo(4));
108+
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Browne", "Jones", "Smith", "Smithers" }));
109109
}
110110

111111
[Test]
@@ -120,11 +120,11 @@ public void B110_GetAll_Paging()
120120
.AssertOK()
121121
.GetValue<EmployeeCollectionResult>();
122122

123-
Assert.IsNotNull(v?.Items);
124-
Assert.AreEqual(2, v!.Items.Count);
125-
Assert.AreEqual(new string[] { "Jones", "Smith" }, v.Items.Select(x => x.LastName).ToArray());
126-
Assert.IsNotNull(v.Paging);
127-
Assert.AreEqual(4, v.Paging!.TotalCount);
123+
Assert.That(v?.Items, Is.Not.Null);
124+
Assert.That(v!.Items, Has.Count.EqualTo(2));
125+
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Jones", "Smith" }));
126+
Assert.That(v.Paging, Is.Not.Null);
127+
Assert.That(v.Paging!.TotalCount, Is.EqualTo(4));
128128
}
129129

130130
[Test]
@@ -138,7 +138,7 @@ public void B120_GetAll_PagingAndIncludeFields()
138138
.AssertJson("[ { \"lastName\": \"Jones\" }, { \"lastName\": \"Smith\" } ]")
139139
.GetValue<EmployeeCollectionResult>();
140140

141-
Assert.IsNull(v!.Paging!.TotalCount); // No count requested.
141+
Assert.That(v!.Paging!.TotalCount, Is.Null); // No count requested.
142142
}
143143

144144
[Test]
@@ -385,9 +385,9 @@ public void G100_Verify_Publish()
385385
.Run(c => c.VerifyAsync(1.ToGuid()))
386386
.AssertAccepted();
387387

388-
Assert.AreEqual(1, imp.GetNames().Length);
388+
Assert.That(imp.GetNames(), Has.Length.EqualTo(1));
389389
var e = imp.GetEvents("pendingVerifications");
390-
Assert.AreEqual(1, e.Length);
390+
Assert.That(e, Has.Length.EqualTo(1));
391391
ObjectComparer.Assert(new EmployeeVerificationRequest { Name = "Wendy", Age = 38, Gender = "F" }, e[0].Value);
392392
}
393393

samples/My.Hr/My.Hr.UnitTest/EmployeeControllerTest2.cs

+17-11
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,12 @@ public void B100_GetAll_All()
9090
.AssertOK()
9191
.GetValue<EmployeeCollectionResult>();
9292

93-
Assert.IsNotNull(v?.Items);
94-
Assert.AreEqual(4, v!.Items.Count);
95-
Assert.AreEqual(new string[] { "Browne", "Jones", "Smith", "Smithers" }, v.Items.Select(x => x.LastName).ToArray());
93+
Assert.Multiple(() =>
94+
{
95+
Assert.That(v?.Items, Is.Not.Null);
96+
Assert.That(v!.Items, Has.Count.EqualTo(4));
97+
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Browne", "Jones", "Smith", "Smithers" }));
98+
});
9699
}
97100

98101
[Test]
@@ -105,11 +108,14 @@ public void B110_GetAll_Paging()
105108
.AssertOK()
106109
.GetValue<EmployeeCollectionResult>();
107110

108-
Assert.IsNotNull(v?.Items);
109-
Assert.AreEqual(2, v!.Items.Count);
110-
Assert.AreEqual(new string[] { "Jones", "Smith" }, v.Items.Select(x => x.LastName).ToArray());
111-
Assert.IsNotNull(v.Paging);
112-
Assert.AreEqual(4, v.Paging!.TotalCount);
111+
Assert.Multiple(() =>
112+
{
113+
Assert.That(v?.Items, Is.Not.Null);
114+
Assert.That(v!.Items, Has.Count.EqualTo(2));
115+
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Jones", "Smith" }));
116+
Assert.That(v.Paging, Is.Not.Null);
117+
});
118+
Assert.That(v.Paging!.TotalCount, Is.EqualTo(4));
113119
}
114120

115121
[Test]
@@ -123,7 +129,7 @@ public void B120_GetAll_PagingAndIncludeFields()
123129
.AssertJson("[ { \"lastName\": \"Jones\" }, { \"lastName\": \"Smith\" } ]")
124130
.GetValue<EmployeeCollectionResult>();
125131

126-
Assert.IsNull(v!.Paging!.TotalCount); // No count requested.
132+
Assert.That(v!.Paging!.TotalCount, Is.Null); // No count requested.
127133
}
128134

129135
[Test]
@@ -370,9 +376,9 @@ public void G100_Verify_Publish()
370376
.Run(c => c.VerifyAsync(1.ToGuid()))
371377
.AssertAccepted();
372378

373-
Assert.AreEqual(1, imp.GetNames().Length);
379+
Assert.That(imp.GetNames(), Has.Length.EqualTo(1));
374380
var e = imp.GetEvents("pendingVerifications");
375-
Assert.AreEqual(1, e.Length);
381+
Assert.That(e, Has.Length.EqualTo(1));
376382
ObjectComparer.Assert(new EmployeeVerificationRequest { Name = "Wendy", Age = 38, Gender = "F" }, e[0].Value);
377383
}
378384

samples/My.Hr/My.Hr.UnitTest/EmployeeFunctionTest.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ public void B100_GetAll_All()
101101
.Run(f => f.GetAllAsync(test.CreateHttpRequest(HttpMethod.Get, "api/employees")))
102102
.GetValue<EmployeeCollectionResult>();
103103

104-
Assert.IsNotNull(v?.Items);
105-
Assert.AreEqual(4, v!.Items.Count);
106-
Assert.AreEqual(new string[] { "Browne", "Jones", "Smith", "Smithers" }, v.Items.Select(x => x.LastName).ToArray());
104+
Assert.That(v?.Items, Is.Not.Null);
105+
Assert.That(v!.Items, Has.Count.EqualTo(4));
106+
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Browne", "Jones", "Smith", "Smithers" }));
107107
}
108108

109109
[Test]
@@ -116,11 +116,11 @@ public void B110_GetAll_Paging()
116116
.AssertOK()
117117
.GetValue<EmployeeCollectionResult>();
118118

119-
Assert.IsNotNull(v?.Items);
120-
Assert.AreEqual(2, v!.Items.Count);
121-
Assert.AreEqual(new string[] { "Jones", "Smith" }, v.Items.Select(x => x.LastName).ToArray());
122-
Assert.IsNotNull(v.Paging);
123-
Assert.AreEqual(4, v.Paging!.TotalCount);
119+
Assert.That(v?.Items, Is.Not.Null);
120+
Assert.That(v!.Items, Has.Count.EqualTo(2));
121+
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Jones", "Smith" }));
122+
Assert.That(v.Paging, Is.Not.Null);
123+
Assert.That(v.Paging!.TotalCount, Is.EqualTo(4));
124124
}
125125

126126
[Test]
@@ -134,7 +134,7 @@ public void B120_GetAll_PagingAndIncludeFields()
134134
.AssertJson("[ { \"lastName\": \"Jones\" }, { \"lastName\": \"Smith\" } ]")
135135
.GetValue<EmployeeCollectionResult>();
136136

137-
Assert.IsNull(v!.Paging!.TotalCount); // No count requested.
137+
Assert.That(v!.Paging!.TotalCount, Is.Null); // No count requested.
138138
}
139139

140140
[Test]

samples/My.Hr/My.Hr.UnitTest/EmployeeResultControllerTest.cs

+17-13
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
using UnitTestEx.Expectations;
1515
using UnitTestEx.NUnit;
1616
using DbEx;
17-
using Microsoft.Extensions.DependencyInjection;
18-
using My.Hr.Business;
1917
using DbEx.Migration;
2018
using DbEx.SqlServer.Migration;
2119

@@ -105,9 +103,12 @@ public void B100_GetAll_All()
105103
.AssertOK()
106104
.GetValue<EmployeeCollectionResult>();
107105

108-
Assert.IsNotNull(v?.Items);
109-
Assert.AreEqual(4, v!.Items.Count);
110-
Assert.AreEqual(new string[] { "Browne", "Jones", "Smith", "Smithers" }, v.Items.Select(x => x.LastName).ToArray());
106+
Assert.Multiple(() =>
107+
{
108+
Assert.That(v?.Items, Is.Not.Null);
109+
Assert.That(v!.Items, Has.Count.EqualTo(4));
110+
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Browne", "Jones", "Smith", "Smithers" }));
111+
});
111112
}
112113

113114
[Test]
@@ -120,11 +121,14 @@ public void B110_GetAll_Paging()
120121
.AssertOK()
121122
.GetValue<EmployeeCollectionResult>();
122123

123-
Assert.IsNotNull(v?.Items);
124-
Assert.AreEqual(2, v!.Items.Count);
125-
Assert.AreEqual(new string[] { "Jones", "Smith" }, v.Items.Select(x => x.LastName).ToArray());
126-
Assert.IsNotNull(v.Paging);
127-
Assert.AreEqual(4, v.Paging!.TotalCount);
124+
Assert.Multiple(() =>
125+
{
126+
Assert.That(v?.Items, Is.Not.Null);
127+
Assert.That(v!.Items, Has.Count.EqualTo(2));
128+
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Jones", "Smith" }));
129+
Assert.That(v.Paging, Is.Not.Null);
130+
});
131+
Assert.That(v.Paging!.TotalCount, Is.EqualTo(4));
128132
}
129133

130134
[Test]
@@ -138,7 +142,7 @@ public void B120_GetAll_PagingAndIncludeFields()
138142
.AssertJson("[ { \"lastName\": \"Jones\" }, { \"lastName\": \"Smith\" } ]")
139143
.GetValue<EmployeeCollectionResult>();
140144

141-
Assert.IsNull(v!.Paging!.TotalCount); // No count requested.
145+
Assert.That(v!.Paging!.TotalCount, Is.Null); // No count requested.
142146
}
143147

144148
[Test]
@@ -385,9 +389,9 @@ public void G100_Verify_Publish()
385389
.Run(c => c.VerifyAsync(1.ToGuid()))
386390
.AssertAccepted();
387391

388-
Assert.AreEqual(1, imp.GetNames().Length);
392+
Assert.That(imp.GetNames(), Has.Length.EqualTo(1));
389393
var e = imp.GetEvents("pendingVerifications");
390-
Assert.AreEqual(1, e.Length);
394+
Assert.That(e, Has.Length.EqualTo(1));
391395
ObjectComparer.Assert(new EmployeeVerificationRequest { Name = "Wendy", Age = 38, Gender = "F" }, e[0].Value);
392396
}
393397

samples/My.Hr/My.Hr.UnitTest/HttpTriggerQueueVerificationFunctionTest.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ public void A110_Verify_Success()
2121
.Run(f => f.RunAsync(test.CreateJsonHttpRequest(HttpMethod.Post, "employee/verify", new EmployeeVerificationRequest { Name = "Wendy", Age = 37, Gender = "F" })))
2222
.AssertAccepted();
2323

24-
Assert.AreEqual(1, imp.GetNames().Length);
24+
Assert.That(imp.GetNames(), Has.Length.EqualTo(1));
25+
2526
var e = imp.GetEvents("pendingVerifications");
26-
Assert.AreEqual(1, e.Length);
27+
Assert.That(e, Has.Length.EqualTo(1));
2728
ObjectComparer.Assert(new EmployeeVerificationRequest { Name = "Wendy", Age = 37, Gender = "F" }, e[0].Value);
2829
}
2930
}

samples/My.Hr/My.Hr.UnitTest/My.Hr.UnitTest.csproj

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121

2222
<ItemGroup>
2323
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
24-
<PackageReference Include="NUnit" Version="3.14.0" />
24+
<PackageReference Include="NUnit" Version="4.0.1" />
25+
<PackageReference Include="NUnit.Analyzers" Version="3.10.0">
26+
<PrivateAssets>all</PrivateAssets>
27+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
28+
</PackageReference>
2529
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
2630
<PackageReference Include="coverlet.collector" Version="6.0.0">
2731
<PrivateAssets>all</PrivateAssets>

samples/My.Hr/My.Hr.UnitTest/ReferenceDataControllerTest.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void A100_USState_All()
2828
.AssertOK()
2929
.GetValue<USState[]>()!;
3030

31-
Assert.AreEqual(50, v.Length);
31+
Assert.That(v, Has.Length.EqualTo(50));
3232
}
3333

3434
[Test]
@@ -41,8 +41,8 @@ public void A110_USState_Codes()
4141
.AssertOK()
4242
.GetValue<USState[]>()!;
4343

44-
Assert.AreEqual(2, v.Length);
45-
Assert.AreEqual(new string[] { "CO", "WA" }, v.Select(x => x.Code));
44+
Assert.That(v, Has.Length.EqualTo(2));
45+
Assert.That(v.Select(x => x.Code), Is.EqualTo(new string[] { "CO", "WA" }));
4646
}
4747

4848
[Test]
@@ -55,9 +55,9 @@ public void A120_USState_Text()
5555
.AssertOK()
5656
.GetValue<USState[]>()!;
5757

58-
Assert.AreEqual(8, v.Length);
58+
Assert.That(v, Has.Length.EqualTo(8));
5959
var x = v.Select(x => x.Code);
60-
Assert.AreEqual(new string[] { "CA", "CO", "FL", "GA", "NY", "NC", "ND", "OR" }, v.Select(x => x.Code));
60+
Assert.That(v.Select(x => x.Code), Is.EqualTo(new string[] { "CA", "CO", "FL", "GA", "NY", "NC", "ND", "OR" }));
6161
}
6262

6363
[Test]
@@ -85,7 +85,7 @@ public void B100_Gender_All()
8585
.AssertOK()
8686
.GetValue<Gender[]>()!;
8787

88-
Assert.AreEqual(3, v.Length);
88+
Assert.That(v, Has.Length.EqualTo(3));
8989
}
9090

9191
[Test]
@@ -94,7 +94,7 @@ public void C100_Named()
9494
using var test = ApiTester.Create<Startup>().UseJsonSerializer(new ReferenceDataContentJsonSerializer().ToUnitTestEx());
9595

9696
var r = test.Controller<ReferenceDataController>()
97-
.Run(c => c.GetNamed(), new HttpRequestOptions { UrlQueryString = "gender&usstate" })
97+
.Run(c => c.GetNamed(), requestOptions: new HttpRequestOptions { UrlQueryString = "gender&usstate" })
9898
.AssertOK();
9999
}
100100
}

samples/My.Hr/My.Hr.UnitTest/ServiceBusExecuteVerificationFunctionTest.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ public void A110_Verify_Success()
6767
.Run(f => f.RunAsync(sbm, sba.Object))
6868
.AssertSuccess();
6969

70-
Assert.AreEqual(1, imp.GetNames().Length);
70+
Assert.That(imp.GetNames(), Has.Length.EqualTo(1));
7171
var e = imp.GetEvents("verificationResults");
72-
Assert.AreEqual(1, e.Length);
72+
Assert.That(e, Has.Length.EqualTo(1));
7373
if (Environment.OSVersion.Platform == PlatformID.Unix)
7474
ObjectComparer.Assert(UnitTestEx.Resource.GetJsonValue<EmployeeVerificationResponse>("VerificationResult.Unix.json"), e[0].Value);
7575
else

src/CoreEx.Azure/CoreEx.Azure.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<ItemGroup>
1717
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.17.1" />
1818
<PackageReference Include="Azure.Storage.Blobs" Version="12.19.1" />
19+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.ServiceBus" Version="5.15.0" />
1920
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.2.0" />
2021
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="5.13.5" />
2122
<PackageReference Include="Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="7.0.0" />

0 commit comments

Comments
 (0)