Skip to content

Commit bb60e34

Browse files
authored
v3.30.0 (#132)
- *Enhancement:* Integrated `UnitTestEx` version `5.0.0` to enable the latest capabilities and improvements. - `CoreEx.UnitTesting.NUnit` given changes is no longer required and has been deprecated, the `UnitTestEx.NUnit` (or other) must be explicitly referenced as per testing framework being used. - `CoreEx.UnitTesting` package updated to include only standard .NET core capabilities to follow new `UnitTestEx` pattern; new packages created to house specific as follows: - `CoreEx.UnitTesting.Azure.Functions` created to house Azure Functions specific capabilities; - `CoreEx.UnitTesting.Azure.ServiceBus` created to house Azure Service Bus specific capabilities. - Existing usage will require references to the new packages as required. There should be limited need to update existing tests to use beyond the requirement for the root `UnitTestEx` namespace. The updated default within `UnitTestEx` is to expose the key capabilities from the root namespa
1 parent a3f7515 commit bb60e34

File tree

66 files changed

+445
-314
lines changed

Some content is hidden

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

66 files changed

+445
-314
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
Represents the **NuGet** versions.
44

5+
## v3.30.0
6+
- *Enhancement:* Integrated `UnitTestEx` version `5.0.0` to enable the latest capabilities and improvements.
7+
- `CoreEx.UnitTesting.NUnit` given changes is no longer required and has been deprecated, the `UnitTestEx.NUnit` (or other) must be explicitly referenced as per testing framework being used.
8+
- `CoreEx.UnitTesting` package updated to include only standard .NET core capabilities to follow new `UnitTestEx` pattern; new packages created to house specific as follows:
9+
- `CoreEx.UnitTesting.Azure.Functions` created to house Azure Functions specific capabilities;
10+
- `CoreEx.UnitTesting.Azure.ServiceBus` created to house Azure Service Bus specific capabilities.
11+
- Existing usage will require references to the new packages as required. There should be limited need to update existing tests to use beyond the requirement for the root `UnitTestEx` namespace. The updated default within `UnitTestEx` is to expose the key capabilities from the root namespace. For example, `using UnitTestEx.NUnit`, should be replaced with `using UnitTestEx`.
12+
513
## v3.29.0
614
- *Enhancement:* Added `net9.0` support.
715
- *Enhancement:* Deprecated `net7.0` support; no longer supported by [Microsoft](https://dotnet.microsoft.com/en-us/platform/support/policy).

Common.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>3.29.0</Version>
3+
<Version>3.30.0</Version>
44
<LangVersion>preview</LangVersion>
55
<Authors>Avanade</Authors>
66
<Company>Avanade</Company>

CoreEx.sln

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UnitTesting", "UnitTesting"
8282
EndProject
8383
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreEx.UnitTesting", "src\CoreEx.UnitTesting\CoreEx.UnitTesting.csproj", "{AC247FD3-5F9F-4DD2-B0CB-1C9CD1EB98D2}"
8484
EndProject
85-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreEx.UnitTesting.NUnit", "src\CoreEx.UnitTesting.NUnit\CoreEx.UnitTesting.NUnit.csproj", "{91910971-4B1A-4791-9BB4-65FAB3ED3C76}"
86-
EndProject
8785
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreEx.TestFunctionIso", "tests\CoreEx.TestFunctionIso\CoreEx.TestFunctionIso.csproj", "{6F7B4F1E-3C3A-4CD7-A9BF-973A5053C1C8}"
8886
EndProject
8987
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreEx.Test2", "tests\CoreEx.Test2\CoreEx.Test2.csproj", "{910B5894-46BC-4427-95D6-2804F06458E3}"
@@ -92,6 +90,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreEx.Database.Postgres",
9290
EndProject
9391
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreEx.Data", "src\CoreEx.Data\CoreEx.Data.csproj", "{B927138A-1DCA-4BA6-A9E5-E5DA6446DABC}"
9492
EndProject
93+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreEx.UnitTesting.Azure.Functions", "src\CoreEx.UnitTesting.Azure.Functions\CoreEx.UnitTesting.Azure.Functions.csproj", "{2BBB766A-D8A2-47B4-AD42-1FD96051604C}"
94+
EndProject
95+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreEx.UnitTesting.Azure.ServiceBus", "src\CoreEx.UnitTesting.Azure.ServiceBus\CoreEx.UnitTesting.Azure.ServiceBus.csproj", "{CA21C777-2592-4E1A-970B-0888F21AB0D7}"
96+
EndProject
9597
Global
9698
GlobalSection(SolutionConfigurationPlatforms) = preSolution
9799
Debug|Any CPU = Debug|Any CPU
@@ -202,10 +204,6 @@ Global
202204
{AC247FD3-5F9F-4DD2-B0CB-1C9CD1EB98D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
203205
{AC247FD3-5F9F-4DD2-B0CB-1C9CD1EB98D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
204206
{AC247FD3-5F9F-4DD2-B0CB-1C9CD1EB98D2}.Release|Any CPU.Build.0 = Release|Any CPU
205-
{91910971-4B1A-4791-9BB4-65FAB3ED3C76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
206-
{91910971-4B1A-4791-9BB4-65FAB3ED3C76}.Debug|Any CPU.Build.0 = Debug|Any CPU
207-
{91910971-4B1A-4791-9BB4-65FAB3ED3C76}.Release|Any CPU.ActiveCfg = Release|Any CPU
208-
{91910971-4B1A-4791-9BB4-65FAB3ED3C76}.Release|Any CPU.Build.0 = Release|Any CPU
209207
{6F7B4F1E-3C3A-4CD7-A9BF-973A5053C1C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
210208
{6F7B4F1E-3C3A-4CD7-A9BF-973A5053C1C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
211209
{6F7B4F1E-3C3A-4CD7-A9BF-973A5053C1C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -222,6 +220,14 @@ Global
222220
{B927138A-1DCA-4BA6-A9E5-E5DA6446DABC}.Debug|Any CPU.Build.0 = Debug|Any CPU
223221
{B927138A-1DCA-4BA6-A9E5-E5DA6446DABC}.Release|Any CPU.ActiveCfg = Release|Any CPU
224222
{B927138A-1DCA-4BA6-A9E5-E5DA6446DABC}.Release|Any CPU.Build.0 = Release|Any CPU
223+
{2BBB766A-D8A2-47B4-AD42-1FD96051604C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
224+
{2BBB766A-D8A2-47B4-AD42-1FD96051604C}.Debug|Any CPU.Build.0 = Debug|Any CPU
225+
{2BBB766A-D8A2-47B4-AD42-1FD96051604C}.Release|Any CPU.ActiveCfg = Release|Any CPU
226+
{2BBB766A-D8A2-47B4-AD42-1FD96051604C}.Release|Any CPU.Build.0 = Release|Any CPU
227+
{CA21C777-2592-4E1A-970B-0888F21AB0D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
228+
{CA21C777-2592-4E1A-970B-0888F21AB0D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
229+
{CA21C777-2592-4E1A-970B-0888F21AB0D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
230+
{CA21C777-2592-4E1A-970B-0888F21AB0D7}.Release|Any CPU.Build.0 = Release|Any CPU
225231
EndGlobalSection
226232
GlobalSection(SolutionProperties) = preSolution
227233
HideSolutionNode = FALSE
@@ -255,11 +261,12 @@ Global
255261
{2A31E887-0340-47D2-AF80-D88D2866C80E} = {4B6BC31E-93B1-42B0-AE09-AD85AC4DB657}
256262
{D2C61D4A-2A6D-4284-BF9D-09F51BA735B8} = {4B6BC31E-93B1-42B0-AE09-AD85AC4DB657}
257263
{AC247FD3-5F9F-4DD2-B0CB-1C9CD1EB98D2} = {D2C61D4A-2A6D-4284-BF9D-09F51BA735B8}
258-
{91910971-4B1A-4791-9BB4-65FAB3ED3C76} = {D2C61D4A-2A6D-4284-BF9D-09F51BA735B8}
259264
{6F7B4F1E-3C3A-4CD7-A9BF-973A5053C1C8} = {3145DCB9-98FB-4519-BCC0-75A22A252EDC}
260265
{910B5894-46BC-4427-95D6-2804F06458E3} = {3145DCB9-98FB-4519-BCC0-75A22A252EDC}
261266
{C042AC2A-415D-432E-83FA-B911FD9ED378} = {4B6BC31E-93B1-42B0-AE09-AD85AC4DB657}
262267
{B927138A-1DCA-4BA6-A9E5-E5DA6446DABC} = {4B6BC31E-93B1-42B0-AE09-AD85AC4DB657}
268+
{2BBB766A-D8A2-47B4-AD42-1FD96051604C} = {D2C61D4A-2A6D-4284-BF9D-09F51BA735B8}
269+
{CA21C777-2592-4E1A-970B-0888F21AB0D7} = {D2C61D4A-2A6D-4284-BF9D-09F51BA735B8}
263270
EndGlobalSection
264271
GlobalSection(ExtensibilityGlobals) = postSolution
265272
SolutionGuid = {8B4566D2-9B22-4E27-9654-402BDBA6C744}

nuget-publish.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ param(
6565
"src\CoreEx.Newtonsoft",
6666
"src\CoreEx.Validation",
6767
"src\CoreEx.UnitTesting",
68-
"src\CoreEx.UnitTesting.NUnit")
68+
"src\CoreEx.UnitTesting.Azure.Functions",
69+
"src\CoreEx.UnitTesting.Azure.ServiceBus")
6970
)
7071

7172
$ShouldPublishRemote = (![string]::IsNullOrEmpty($apiKey) -and ![string]::IsNullOrEmpty($NugetServer))

samples/My.Hr/My.Hr.Functions/My.Hr.Functions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ItemGroup>
88
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.OpenApi" Version="1.5.1" />
99
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
10-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.4.1" />
10+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.6.0" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

samples/My.Hr/My.Hr.UnitTest/DatabaseTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using System;
88
using System.Collections.Generic;
99
using System.Threading.Tasks;
10-
using UnitTestEx.NUnit;
10+
using UnitTestEx;
1111

1212
namespace My.Hr.UnitTest
1313
{

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

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using System.Threading.Tasks;
1313
using UnitTestEx;
1414
using UnitTestEx.Expectations;
15-
using UnitTestEx.NUnit;
1615
using DbEx;
1716
using DbEx.Migration;
1817
using DbEx.SqlServer.Migration;
@@ -77,7 +76,7 @@ public void A110_Get_Found()
7776
Assert.That(result.Messages, Has.Count.EqualTo(1));
7877
Assert.Multiple(() =>
7978
{
80-
Assert.That(result.Messages[0].Type, Is.EqualTo(MessageType.Warning));
79+
Assert.That(result.Messages![0].Type, Is.EqualTo(MessageType.Warning));
8180
Assert.That(result.Messages[0].Text, Is.EqualTo("Employee is considered old."));
8281
});
8382
}
@@ -118,9 +117,12 @@ public void B100_GetAll_All()
118117
.AssertOK()
119118
.GetValue<EmployeeCollectionResult>();
120119

121-
Assert.That(v?.Items, Is.Not.Null);
122-
Assert.That(v!.Items, Has.Count.EqualTo(4));
123-
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Browne", "Jones", "Smith", "Smithers" }));
120+
Assert.Multiple(() =>
121+
{
122+
Assert.That(v?.Items, Is.Not.Null);
123+
Assert.That(v!.Items, Has.Count.EqualTo(4));
124+
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Browne", "Jones", "Smith", "Smithers" }));
125+
});
124126
}
125127

126128
[Test]
@@ -135,11 +137,14 @@ public void B110_GetAll_Paging()
135137
.AssertOK()
136138
.GetValue<EmployeeCollectionResult>();
137139

138-
Assert.That(v?.Items, Is.Not.Null);
139-
Assert.That(v!.Items, Has.Count.EqualTo(2));
140-
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Jones", "Smith" }));
141-
Assert.That(v.Paging, Is.Not.Null);
142-
Assert.That(v.Paging!.TotalCount, Is.EqualTo(4));
140+
Assert.Multiple(() =>
141+
{
142+
Assert.That(v?.Items, Is.Not.Null);
143+
Assert.That(v!.Items, Has.Count.EqualTo(2));
144+
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Jones", "Smith" }));
145+
Assert.That(v.Paging, Is.Not.Null);
146+
});
147+
Assert.That(v!.Paging!.TotalCount, Is.EqualTo(4));
143148
}
144149

145150
[Test]
@@ -166,9 +171,12 @@ public void B120_GetAll_Filter_LastName()
166171
.AssertOK()
167172
.GetValue<EmployeeCollectionResult>();
168173

169-
Assert.That(v?.Items, Is.Not.Null);
170-
Assert.That(v!.Items, Has.Count.EqualTo(2));
171-
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Smith", "Smithers" }));
174+
Assert.Multiple(() =>
175+
{
176+
Assert.That(v?.Items, Is.Not.Null);
177+
Assert.That(v!.Items, Has.Count.EqualTo(2));
178+
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Smith", "Smithers" }));
179+
});
172180
}
173181

174182
[Test]
@@ -181,9 +189,12 @@ public void B130_GetAll_Filter_StartDateAndGenders_OrderBy_FirstName()
181189
.AssertOK()
182190
.GetValue<EmployeeCollectionResult>();
183191

184-
Assert.That(v?.Items, Is.Not.Null);
185-
Assert.That(v!.Items, Has.Count.EqualTo(2));
186-
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Smith", "Browne" }));
192+
Assert.Multiple(() =>
193+
{
194+
Assert.That(v?.Items, Is.Not.Null);
195+
Assert.That(v!.Items, Has.Count.EqualTo(2));
196+
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Smith", "Browne" }));
197+
});
187198
}
188199

189200
[Test]

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
using System.Threading.Tasks;
1212
using UnitTestEx;
1313
using UnitTestEx.Expectations;
14-
using UnitTestEx.NUnit;
1514
using My.Hr.Business.Services;
1615

1716
namespace My.Hr.UnitTest
@@ -115,7 +114,7 @@ public void B110_GetAll_Paging()
115114
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Jones", "Smith" }));
116115
Assert.That(v.Paging, Is.Not.Null);
117116
});
118-
Assert.That(v.Paging!.TotalCount, Is.EqualTo(4));
117+
Assert.That(v!.Paging!.TotalCount, Is.EqualTo(4));
119118
}
120119

121120
[Test]

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

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
using System.Net.Http;
1515
using System.Threading.Tasks;
1616
using UnitTestEx;
17-
using UnitTestEx.NUnit;
1817

1918
namespace My.Hr.UnitTest
2019
{
@@ -101,9 +100,12 @@ public void B100_GetAll_All()
101100
.Run(f => f.GetAllAsync(test.CreateHttpRequest(HttpMethod.Get, "api/employees")))
102101
.GetValue<EmployeeCollectionResult>();
103102

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" }));
103+
Assert.Multiple(() =>
104+
{
105+
Assert.That(v?.Items, Is.Not.Null);
106+
Assert.That(v!.Items, Has.Count.EqualTo(4));
107+
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Browne", "Jones", "Smith", "Smithers" }));
108+
});
107109
}
108110

109111
[Test]
@@ -116,11 +118,14 @@ public void B110_GetAll_Paging()
116118
.AssertOK()
117119
.GetValue<EmployeeCollectionResult>();
118120

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));
121+
Assert.Multiple(() =>
122+
{
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+
});
128+
Assert.That(v!.Paging!.TotalCount, Is.EqualTo(4));
124129
}
125130

126131
[Test]

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using System.Threading.Tasks;
1313
using UnitTestEx;
1414
using UnitTestEx.Expectations;
15-
using UnitTestEx.NUnit;
1615
using DbEx;
1716
using DbEx.Migration;
1817
using DbEx.SqlServer.Migration;
@@ -128,7 +127,7 @@ public void B110_GetAll_Paging()
128127
Assert.That(v.Items.Select(x => x.LastName).ToArray(), Is.EqualTo(new string[] { "Jones", "Smith" }));
129128
Assert.That(v.Paging, Is.Not.Null);
130129
});
131-
Assert.That(v.Paging!.TotalCount, Is.EqualTo(4));
130+
Assert.That(v!.Paging!.TotalCount, Is.EqualTo(4));
132131
}
133132

134133
[Test]

0 commit comments

Comments
 (0)