Skip to content

Conversation

@vbreuss
Copy link
Contributor

@vbreuss vbreuss commented Aug 25, 2025

This PR enhances the type formatting functionality to better handle void and generic type parameters. The changes improve the readability and accuracy of type formatting by using simplified representations for these special cases.

Key changes:

  • Added special formatting for void types to display as "void" instead of the full type name
  • Added special formatting for generic parameters to display only their parameter name (e.g., "T" instead of "IEnumerable<>.T")
  • Updated test expectations to reflect the simplified generic parameter formatting

@vbreuss vbreuss self-assigned this Aug 25, 2025
Copilot AI review requested due to automatic review settings August 25, 2025 15:05
@vbreuss vbreuss added the enhancement New feature or request label Aug 25, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the type formatting functionality to better handle void and generic type parameters. The changes improve the readability and accuracy of type formatting by using simplified representations for these special cases.

Key changes:

  • Added special formatting for void types to display as "void" instead of the full type name
  • Added special formatting for generic parameters to display only their parameter name (e.g., "T" instead of "IEnumerable<>.T")
  • Updated test expectations to reflect the simplified generic parameter formatting

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Source/aweXpect.Core/Formatting/ValueFormatters.Type.cs Added special handling for void types and generic parameters in the FormatType method
Tests/aweXpect.Core.Tests/Formatting/ValueFormatters.TypeTests.cs Updated test expectations for generic parameters and added comprehensive tests for both void and generic parameter formatting

@github-actions
Copy link
Contributor

github-actions bot commented Aug 25, 2025

Test Results

    14 files   - 24      14 suites   - 24   3m 8s ⏱️ -5s
14 359 tests  - 21  14 357 ✅  - 21  2 💤 ±0  0 ❌ ±0 
39 762 runs   - 66  39 760 ✅  - 66  2 💤 ±0  0 ❌ ±0 

Results for commit 4d3fa0c. ± Comparison against base commit 9fa4854.

This pull request removes 1556 and adds 1535 tests. Note that renamed tests count towards both.
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message4642f271-82be-4d44-bbbe-978356eacbd2")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message510eefb5-d2d9-400d-af5e-456c04ad17aa")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "messagedb68f97e-64b8-49d6-b452-ef1884f6e318")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message31da06c4-4abc-43f1-b11f-d12e30d33ca7")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "messagea868add0-dacb-4a7e-97da-aa73f57ff5e7")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "messageb3a9b23e-3350-4ab8-bd8c-ac4e68c36041")
aweXpect.Core.Tests.Equivalency.EquivalencyOptionsExtensionsTests ‑ Generic_For_IgnoringMember_ShouldSetOptionForType(memberToIgnore: "memberToIgnore579ef466-3267-49e3-a666-8ba0f05ab253")
aweXpect.Core.Tests.Equivalency.EquivalencyOptionsExtensionsTests ‑ Generic_For_IgnoringMember_ShouldSetOptionForType(memberToIgnore: "memberToIgnorea4691e18-a2df-478a-b485-38c58e23db4b")
aweXpect.Core.Tests.Equivalency.EquivalencyOptionsExtensionsTests ‑ Generic_For_IgnoringMember_ShouldSetOptionForType(memberToIgnore: "memberToIgnoree35359bb-aa3d-4c2f-8da4-136b160caf63")
aweXpect.Core.Tests.FailTests ‑ Test_ShouldThrowException(reason: "reason4c538c0d-c58a-40d7-adfd-841c684100af")
…
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message1fabb913-3192-4bbd-942e-682fa1093da6")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message93f33a0d-eaf5-457e-a188-08de4fa543ea")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "messagee7331dbb-015d-4b5f-8e3f-f2a343dee3dd")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message988d02a9-1c5b-49da-b3a6-1600a10268d3")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "messagec856bc4a-a980-4995-aa0f-dd6d4e131e68")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "messagefc153e94-0e9b-4388-853c-c820057d351a")
aweXpect.Core.Tests.Equivalency.EquivalencyOptionsExtensionsTests ‑ Generic_For_IgnoringMember_ShouldSetOptionForType(memberToIgnore: "memberToIgnore043e9da5-d494-4a26-9dee-557f52930ecf")
aweXpect.Core.Tests.Equivalency.EquivalencyOptionsExtensionsTests ‑ Generic_For_IgnoringMember_ShouldSetOptionForType(memberToIgnore: "memberToIgnore089a008c-9b48-429d-8791-236362a2dbc1")
aweXpect.Core.Tests.Equivalency.EquivalencyOptionsExtensionsTests ‑ Generic_For_IgnoringMember_ShouldSetOptionForType(memberToIgnore: "memberToIgnore649c3072-935f-47e2-87f7-f86b972c5370")
aweXpect.Core.Tests.FailTests ‑ Test_ShouldThrowException(reason: "reason6c46160e-8886-4a5a-8d7a-73b35174a936")
…

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 25, 2025

🚀 Benchmark Results

Details

BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 8.0.413
[Host] : .NET 8.0.19 (8.0.1925.36514), X64 RyuJIT AVX2

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Method Mean Error StdDev Gen0 Gen1 Allocated
Bool_aweXpect 172.2 ns 0.77 ns 0.60 ns 0.0281 - 472 B
Bool_FluentAssertions 243.6 ns 1.28 ns 1.13 ns 0.0567 - 952 B
Bool_TUnit 880.4 ns 4.20 ns 3.93 ns 0.1431 - 2408 B
Equivalency_aweXpect 294,868.8 ns 1,208.04 ns 1,070.89 ns 16.6016 0.4883 284940 B
Equivalency_FluentAssertions 2,211,692.1 ns 6,448.33 ns 6,031.78 ns 273.4375 46.8750 4584416 B
Equivalency_TUnit 694,332.7 ns 1,550.52 ns 1,374.49 ns 51.7578 2.9297 880545 B
Int_GreaterThan_aweXpect 203.9 ns 0.31 ns 0.28 ns 0.0467 - 784 B
Int_GreaterThan_FluentAssertions 240.1 ns 1.30 ns 1.22 ns 0.0730 - 1224 B
Int_GreaterThan_TUnit 1,164.0 ns 4.46 ns 3.95 ns 0.1774 - 2984 B
ItemsCount_AtLeast_aweXpect 470.5 ns 1.75 ns 1.55 ns 0.0854 - 1432 B
ItemsCount_AtLeast_FluentAssertions 479.8 ns 1.73 ns 1.44 ns 0.1192 - 2008 B
ItemsCount_AtLeast_TUnit 18,798.0 ns 50.60 ns 44.85 ns 1.6174 - 27480 B
String_aweXpect 336.1 ns 3.47 ns 3.25 ns 0.0672 - 1128 B
String_FluentAssertions 460.2 ns 2.11 ns 1.97 ns 0.1292 - 2168 B
String_TUnit 1,189.6 ns 3.83 ns 3.58 ns 0.1831 - 3072 B
StringArray_aweXpect 1,329.6 ns 2.53 ns 2.36 ns 0.1640 - 2744 B
StringArray_FluentAssertions 1,326.9 ns 6.29 ns 5.88 ns 0.2480 - 4152 B
StringArray_TUnit 3,184.1 ns 6.49 ns 5.42 ns 0.3128 - 5296 B
StringArrayInAnyOrder_aweXpect 1,573.4 ns 3.48 ns 3.25 ns 0.1736 - 2920 B
StringArrayInAnyOrder_FluentAssertions 148,947.8 ns 775.48 ns 725.38 ns 3.4180 - 63787 B
StringArrayInAnyOrder_TUnit 3,813.1 ns 14.07 ns 13.16 ns 0.3853 - 6488 B

@github-actions
Copy link
Contributor

👽 Mutation Results

Mutation testing badge

aweXpect

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants

The final mutation score is NaN%

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

aweXpect.Core

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants
Formatting/ValueFormatters.Type.cs 96.61% 57 2 0 0 18 13 57 2 90

The final mutation score is 96.61%

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

@sonarqubecloud
Copy link

@vbreuss vbreuss enabled auto-merge (squash) August 25, 2025 15:36
@vbreuss vbreuss merged commit 7f21274 into main Aug 25, 2025
14 checks passed
@vbreuss vbreuss deleted the topic/format-void-and-generic-parameters branch August 25, 2025 15:39
github-actions bot added a commit that referenced this pull request Aug 25, 2025
github-actions bot added a commit that referenced this pull request Aug 25, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2025

This is addressed in release v2.22.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request state: released The issue is released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Correctly format void and generic types

2 participants