Skip to content

Commit 5f5127d

Browse files
authored
v5.7.0 (#97)
* v5.7.0 - *Enhancement:* Added `.NET10.0` support to all `UnitTestEx` packages. - *Enhancement:* Added `AssertNoNamedHeader` to the `HttpResponseMessageAssertor` to enable asserting that a named header is not present in the response. * Fix CI for NET10.0
1 parent 6479533 commit 5f5127d

File tree

15 files changed

+42
-13
lines changed

15 files changed

+42
-13
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
7.0.x
2222
8.0.x
2323
9.0.x
24+
10.0.x
2425
2526
- name: Restore dependencies
2627
run: dotnet restore

CHANGELOG.md

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

33
Represents the **NuGet** versions.
44

5+
## v5.7.0
6+
- *Enhancement:* Added `.NET10.0` support to all `UnitTestEx` packages.
7+
- *Enhancement:* Added `AssertNoNamedHeader` to the `HttpResponseMessageAssertor` to enable asserting that a named header is not present in the response.
8+
59
## v5.6.3
610
- *Fixed:* `TestSetUp` fixed to load _all_ assemblies on start up (versus selective) to ensure all `OneOffTestSetUpAttribute` implementations are executed prior to any test executions.
711
- *Fixed:* Added `IJsonSerializer.Clone()` and `JsonElementComparerOptions.Clone` to ensure cross test contamination does not occur.

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>5.6.3</Version>
3+
<Version>5.7.0</Version>
44
<LangVersion>preview</LangVersion>
55
<Authors>Avanade</Authors>
66
<Company>Avanade</Company>

src/UnitTestEx.Azure.Functions/UnitTestEx.Azure.Functions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0;net10.0</TargetFrameworks>
55
<RootNamespace>UnitTestEx</RootNamespace>
66
<Product>UnitTestEx</Product>
77
<Title>UnitTestEx Azure Functions Test Extensions.</Title>

src/UnitTestEx.Azure.ServiceBus/UnitTestEx.Azure.ServiceBus.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0;net10.0</TargetFrameworks>
55
<RootNamespace>UnitTestEx</RootNamespace>
66
<Product>UnitTestEx</Product>
77
<Title>UnitTestEx Azure Functions Test Extensions.</Title>

src/UnitTestEx.MSTest/UnitTestEx.MSTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0;net10.0</TargetFrameworks>
55
<RootNamespace>UnitTestEx.MSTest</RootNamespace>
66
<Product>UnitTestEx MSTest</Product>
77
<Title>UnitTestEx MSTest Test Extensions.</Title>

src/UnitTestEx.NUnit/UnitTestEx.NUnit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0;net10.0</TargetFrameworks>
55
<RootNamespace>UnitTestEx.NUnit</RootNamespace>
66
<Product>UnitTestEx NUnit</Product>
77
<Title>UnitTestEx NUnit Test Extensions.</Title>

src/UnitTestEx.Xunit/UnitTestEx.Xunit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0;net10.0</TargetFrameworks>
55
<RootNamespace>UnitTestEx.Xunit</RootNamespace>
66
<Product>UnitTestEx Xunit</Product>
77
<Title>UnitTestEx Xunit Test Extensions.</Title>

src/UnitTestEx/Assertors/HttpResponseMessageAssertorBaseT.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public TSelf AssertErrors(params ApiError[] errors)
213213

214214
try
215215
{
216-
val = GetValue<IDictionary<string, string[]>>(null);
216+
val = GetValue<IDictionary<string, string[]>>(null);
217217
}
218218
catch (Exception)
219219
{
@@ -295,5 +295,18 @@ public TSelf AssertNamedHeader(string name, params string[] values)
295295

296296
return (TSelf)this;
297297
}
298+
299+
/// <summary>
300+
/// Asserts that a response header does not exist with the specified <paramref name="name"/>.
301+
/// </summary>
302+
/// <param name="name">The header name.</param>
303+
/// <returns>The <see cref="HttpResponseMessageAssertorBase{TSelf}"/> instance to support fluent-style method-chaining.</returns>
304+
public TSelf AssertNoNamedHeader(string name)
305+
{
306+
if (Response.Headers.TryGetValues(name ?? throw new ArgumentNullException(nameof(name)), out var _))
307+
Implementor.AssertFail($"The '{name}' header was found when it was expected to be absent.");
308+
309+
return (TSelf)this;
310+
}
298311
}
299312
}

src/UnitTestEx/UnitTestEx.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0;net10.0</TargetFrameworks>
55
<RootNamespace>UnitTestEx</RootNamespace>
66
<Product>UnitTestEx</Product>
77
<Title>UnitTestEx Test Extensions.</Title>
@@ -39,6 +39,12 @@
3939
<PackageReference Include="System.Text.Json" Version="9.0.0" />
4040
</ItemGroup>
4141

42+
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
43+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.0" />
44+
<PackageReference Include="System.Memory.Data" Version="10.0.0" />
45+
<PackageReference Include="System.Text.Json" Version="10.0.0" />
46+
</ItemGroup>
47+
4248
<Import Project="..\..\Common.targets" />
4349

4450
</Project>

0 commit comments

Comments
 (0)