Skip to content

fix: follow the message conventions of aweXpect - #176

Merged
vbreuss merged 1 commit into
fix/arguments-and-null-subjectsfrom
fix/message-conventions
Oct 10, 2026
Merged

vbreuss merged 1 commit into
fix/arguments-and-null-subjectsfrom
fix/message-conventions

Conversation

@vbreuss

@vbreuss vbreuss commented Oct 10, 2026

Copy link
Copy Markdown
Member

The failure messages now read like the built-in ones: a string that belongs to the subject (request URI, string content, content type, header value) is named as its member instead of being reported as the subject itself, header names and methods are formatted like every other value, the header-value texts start with the subject instead of writing their own, and the expectation texts use the plural verb when the subject is plural. The request URI expectation states that it ignores case, and a negated header value no longer reads as a double negation, because the negation belongs to the header, like for Whose.

Setting a problem-details option a second time now throws at the call, like the options of aweXpect, instead of silently replacing the first value while the message lists both.

The failure messages now read like the built-in ones: a string that belongs to the subject (request URI, string content, content type, header value) is named as its member instead of being reported as the subject itself, header names and methods are formatted like every other value, the header-value texts start with the subject instead of writing their own, and the expectation texts use the plural verb when the subject is plural. The request URI expectation states that it ignores case, and a negated header value no longer reads as a double negation, because the negation belongs to the header, like for `Whose`.

Setting a problem-details option a second time now throws at the call, like the options of aweXpect, instead of silently replacing the first value while the message lists both.
@vbreuss
vbreuss added this pull request to stack #178 October 10, 2026 08:21
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Test Results

   19 files  ±  0     19 suites  ±0   18s ⏱️ -4s
  740 tests + 41    739 ✅ + 41  1 💤 ±0  0 ❌ ±0 
4 408 runs  +246  4 407 ✅ +246  1 💤 ±0  0 ❌ ±0 

Results for commit d89e044. ± Comparison against base commit b2ce649.

@vbreuss
vbreuss merged commit 1b6bf05 into main Oct 10, 2026
16 checks passed
@vbreuss
vbreuss deleted the fix/message-conventions branch October 10, 2026 08:40
@github-actions

Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 9V74 3.69GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.303
[Host] : .NET 8.0.31 (8.0.31, 8.0.3126.42015), X64 RyuJIT x86-64-v4
DefaultJob : .NET 8.0.31 (8.0.31, 8.0.3126.42015), X64 RyuJIT x86-64-v4

Method Mean Error StdDev Gen0 Allocated
Content_aweXpect 391.3 ns 5.64 ns 5.28 ns 0.0639 1072 B
SuccessStatusCode_aweXpect 208.7 ns 2.54 ns 2.25 ns 0.0525 880 B

@github-actions

Copy link
Copy Markdown

👽 Mutation Results

Mutation testing badge

aweXpect.Web

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Runtime Errors Total Detected Total Undetected Total Mutants
Helpers/ThrowHelper.cs 100.00% 6 0 0 0 4 0 0 6 0 10
ThatHttpRequestMessage.HasContent.cs 91.67% 22 2 0 0 6 10 0 22 2 40
ThatHttpRequestMessage.HasHeader.cs 100.00% 25 0 0 0 6 15 0 25 0 46
ThatHttpRequestMessage.HasMethod.cs 90.00% 27 2 0 1 5 13 0 27 3 48
ThatHttpRequestMessage.HasRequestUri.cs 100.00% 16 0 0 0 4 7 0 16 0 27
ThatHttpResponseMessage.HasContent.cs 84.21% 16 1 0 2 6 10 0 16 3 35
ThatHttpResponseMessage.HasContentType.cs 88.24% 15 2 0 0 5 9 0 15 2 31
ThatHttpResponseMessage.HasHeader.cs 100.00% 25 0 0 0 6 15 0 25 0 46
ThatHttpResponseMessage.HasProblemDetailsContent.cs 92.86% 78 6 0 0 16 50 0 78 6 150
ThatHttpResponseMessage.HasRequestMessage.cs 75.00% 3 1 0 0 1 0 0 3 1 5
ThatHttpResponseMessage.HasStatusCode.cs 100.00% 1 0 0 0 0 0 0 1 0 1
ThatUri.HasDefaultPort.cs 100.00% 13 0 0 0 2 6 0 13 0 21
ThatUri.HasScheme.cs 100.00% 1 0 0 0 0 0 0 1 0 1
ThatUri.IsAbsolute.cs 100.00% 11 0 0 0 2 4 0 11 0 17
ThatUri.IsFile.cs 100.00% 11 0 0 0 2 4 0 11 0 17
ThatUri.IsLoopback.cs 100.00% 13 0 0 0 2 6 0 13 0 21
ThatUri.IsUnc.cs 100.00% 11 0 0 0 2 4 0 11 0 17
Web/Results/HasHeaderValueResult.cs 81.08% 30 4 0 3 10 11 0 30 7 58
Web/Results/ProblemDetailsOptions.cs 92.86% 39 3 0 0 4 3 0 39 3 49
Web/Results/StatusCodeResult.cs 100.00% 55 0 0 0 2 7 0 55 0 64

The final mutation score is 93.93%

Coverage Thresholds: high:80 low:60 break:0

@github-actions

Copy link
Copy Markdown

This is addressed in release v2.0.0.

@github-actions github-actions Bot added the state: released The issue is released label Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: released The issue is released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant