diff --git a/.claude/.sourcyignore b/.claude/.sourcyignore
new file mode 100644
index 00000000000..8b137891791
--- /dev/null
+++ b/.claude/.sourcyignore
@@ -0,0 +1 @@
+
diff --git a/.claude/docs/mandatory-rules.md b/.claude/docs/mandatory-rules.md
index 805e1820ad9..24ab6b411a2 100644
--- a/.claude/docs/mandatory-rules.md
+++ b/.claude/docs/mandatory-rules.md
@@ -35,8 +35,8 @@ TUnit supports two execution modes that MUST produce identical behavior:
## Rule 2: Snapshot Testing
Run snapshot tests when changing:
-- Source generator output → `dotnet test TUnit.Core.SourceGenerator.Tests`
-- Public APIs → `dotnet test TUnit.PublicAPI`
+- Source generator output → `dotnet test tests/TUnit.Core.SourceGenerator.Tests`
+- Public APIs → `dotnet test tests/TUnit.PublicAPI`
See `CLAUDE.md` for the quick fix workflow.
@@ -95,6 +95,6 @@ public void InvokeTest(MethodInfo method) { }
### Verification
```bash
-cd TUnit.TestProject
+cd tests/TUnit.TestProject
dotnet publish -c Release -p:PublishAot=true --use-current-runtime
```
diff --git a/.claude/docs/project-structure.md b/.claude/docs/project-structure.md
index 089d729ce28..590665c4508 100644
--- a/.claude/docs/project-structure.md
+++ b/.claude/docs/project-structure.md
@@ -2,6 +2,20 @@
---
+## Repository Layout
+
+| Directory | Contents |
+|-----------|----------|
+| `src/` | Product libraries, analyzers, source generators, integrations, templates, and packaged tools |
+| `tests/` | Unit, integration, snapshot, fixture, and test-application projects |
+| `benchmarks/` | Performance benchmarks and profiling workloads |
+| `examples/` | Sample applications and test projects |
+| `tools/` | CI pipeline and developer utilities |
+| `eng/` | Shared MSBuild imports, signing key, and engineering assets |
+| `scripts/` | Local test and profiling scripts |
+
+Project names below are relative to their category directory. Production projects live under `src/`, test projects under `tests/`, and benchmark projects under `benchmarks/` unless noted.
+
## Core Projects
| Project | Purpose |
@@ -23,7 +37,7 @@
| `TUnit.PropertyTesting` | Property-based testing |
| `TUnit.FsCheck` | F#-based property testing integration |
| `TUnit.Playwright` | Browser testing integration |
-| `TUnit.Pipeline` | CI/CD pipeline orchestration |
+| `tools/TUnit.Pipeline` | CI/CD pipeline orchestration |
| `TUnit.Templates` | `dotnet new` project templates |
## Test Projects
diff --git a/.claude/docs/troubleshooting.md b/.claude/docs/troubleshooting.md
index 0e788841b6a..9de673431de 100644
--- a/.claude/docs/troubleshooting.md
+++ b/.claude/docs/troubleshooting.md
@@ -58,7 +58,7 @@ See `mandatory-rules.md` for annotation patterns.
**Diagnose**:
```bash
-cd TUnit.Performance.Tests
+cd benchmarks/TUnit.Performance.Tests
dotnet run -c Release
```
diff --git a/.claude/docs/workflows.md b/.claude/docs/workflows.md
index 909fe40e1b7..49cc55270fc 100644
--- a/.claude/docs/workflows.md
+++ b/.claude/docs/workflows.md
@@ -20,8 +20,8 @@ dotnet build TUnit.slnx --no-restore -graphBuild:True
dotnet test
# Snapshot tests
-dotnet test TUnit.Core.SourceGenerator.Tests
-dotnet test TUnit.PublicAPI
+dotnet test tests/TUnit.Core.SourceGenerator.Tests
+dotnet test tests/TUnit.PublicAPI
# Run specific test
dotnet test --treenode-filter "/*/*/ClassName/*"
@@ -41,15 +41,15 @@ Run benchmarks when changing hot paths (test discovery, execution, data generati
```bash
# Core performance benchmarks (BenchmarkDotNet)
-cd TUnit.Performance.Tests
+cd benchmarks/TUnit.Performance.Tests
dotnet run -c Release
# Source generator benchmarks
-cd TUnit.SourceGenerator.Benchmarks
+cd benchmarks/TUnit.SourceGenerator.Benchmarks
dotnet run -c Release
# Large-scale performance validation
-cd TUnit.PerformanceBenchmarks
+cd benchmarks/TUnit.PerformanceBenchmarks
dotnet run -c Release
```
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index a859b31ea21..59d5fa349c6 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -146,14 +146,14 @@ When contributing code to TUnit, please keep these important requirements in min
TUnit supports both source-generated and reflection-based test discovery. **All changes that affect test discovery or execution must work identically in both modes:**
-- Source Generator path: `TUnit.Core.SourceGenerator`
-- Reflection path: `TUnit.Engine`
+- Source Generator path: `src/TUnit.Core.SourceGenerator`
+- Reflection path: `src/TUnit.Engine`
#### Snapshot Testing
If your changes affect the source generator output or public APIs:
-1. Run the relevant tests: `dotnet test TUnit.Core.SourceGenerator.Tests` or `dotnet test TUnit.PublicAPI`
+1. Run the relevant tests: `dotnet test tests/TUnit.Core.SourceGenerator.Tests` or `dotnet test tests/TUnit.PublicAPI`
2. Review any `.received.txt` files generated
3. If the changes are intentional, rename them to `.verified.txt`
4. Commit the `.verified.txt` files with your changes
diff --git a/.github/actions/execute-pipeline/action.yml b/.github/actions/execute-pipeline/action.yml
index 057619990c5..8e1402f5b2e 100644
--- a/.github/actions/execute-pipeline/action.yml
+++ b/.github/actions/execute-pipeline/action.yml
@@ -31,7 +31,7 @@ runs:
- name: Run Pipeline
shell: bash
run: dotnet run -c Release --no-build --categories ${{ inputs.categories }}
- working-directory: "TUnit.Pipeline"
+ working-directory: "tools/TUnit.Pipeline"
env:
ADMIN_TOKEN: ${{ inputs.admin-token }}
GITHUB_TOKEN: ${{ github.token }}
diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
index 4655ae94bef..fedfa92f3a9 100644
--- a/.github/copilot-instructions.md
+++ b/.github/copilot-instructions.md
@@ -29,14 +29,14 @@
2. **SNAPSHOT TESTS ARE NON-NEGOTIABLE**
- After ANY change to source generator output:
```bash
- dotnet test TUnit.Core.SourceGenerator.Tests
+ dotnet test tests/TUnit.Core.SourceGenerator.Tests
# Review .received.txt files, then:
for f in *.received.txt; do mv "$f" "${f%.received.txt}.verified.txt"; done # Linux/macOS
for %f in (*.received.txt) do move /Y "%f" "%~nf.verified.txt" # Windows
```
- After ANY public API change (TUnit.Core, TUnit.Engine, TUnit.Assertions):
```bash
- dotnet test TUnit.PublicAPI
+ dotnet test tests/TUnit.PublicAPI
# Review and accept snapshots as above
```
- Commit ALL `.verified.txt` files. These are the source of truth.
@@ -67,17 +67,17 @@
```bash
# ❌ WRONG - Will show many "failures" (this is expected behavior)
-cd TUnit.TestProject && dotnet run
-cd TUnit.TestProject && dotnet test
+cd tests/TUnit.TestProject && dotnet run
+cd tests/TUnit.TestProject && dotnet test
# ✅ CORRECT - Always use targeted filters when testing TUnit.TestProject
-cd TUnit.TestProject && dotnet test --treenode-filter "/*/*/SpecificClass/*"
-cd TUnit.TestProject && dotnet test --treenode-filter "/*/*/*/*[Category!=Performance]"
+cd tests/TUnit.TestProject && dotnet test --treenode-filter "/*/*/SpecificClass/*"
+cd tests/TUnit.TestProject && dotnet test --treenode-filter "/*/*/*/*[Category!=Performance]"
# ✅ CORRECT - Test other test projects normally (they don't have intentional failures)
-dotnet test TUnit.Engine.Tests
-dotnet test TUnit.Assertions.Tests
-dotnet test TUnit.Core.SourceGenerator.Tests
+dotnet test tests/TUnit.Engine.Tests
+dotnet test tests/TUnit.Assertions.Tests
+dotnet test tests/TUnit.Core.SourceGenerator.Tests
```
**Why TUnit.TestProject is special:**
@@ -98,11 +98,11 @@ dotnet test TUnit.Core.SourceGenerator.Tests
dotnet test
# Test source generator + accept snapshots
-dotnet test TUnit.Core.SourceGenerator.Tests
+dotnet test tests/TUnit.Core.SourceGenerator.Tests
for f in *.received.txt; do mv "$f" "${f%.received.txt}.verified.txt"; done
# Test public API + accept snapshots
-dotnet test TUnit.PublicAPI
+dotnet test tests/TUnit.PublicAPI
for f in *.received.txt; do mv "$f" "${f%.received.txt}.verified.txt"; done
# Run specific test by tree node filter
@@ -270,13 +270,13 @@ TUnit has two execution paths that **MUST** behave identically:
dotnet test
# If source generator changed, accept snapshots
- cd TUnit.Core.SourceGenerator.Tests
+ cd tests/TUnit.Core.SourceGenerator.Tests
dotnet test
# Review .received.txt files
for f in *.received.txt; do mv "$f" "${f%.received.txt}.verified.txt"; done
# If public API changed, accept snapshots
- cd TUnit.PublicAPI
+ cd tests/TUnit.PublicAPI
dotnet test
# Review .received.txt files
for f in *.received.txt; do mv "$f" "${f%.received.txt}.verified.txt"; done
@@ -285,13 +285,13 @@ TUnit has two execution paths that **MUST** behave identically:
4. **Performance Check**
```bash
# Run benchmarks (if touching hot paths)
- cd TUnit.Performance.Tests
+ cd benchmarks/TUnit.Performance.Tests
dotnet run -c Release --framework net9.0
```
5. **AOT Verification** (if touching reflection)
```bash
- cd TUnit.TestProject
+ cd tests/TUnit.TestProject
dotnet publish -c Release -p:PublishAot=true --use-current-runtime
```
@@ -647,7 +647,7 @@ public Task GeneratesCorrectCode_ForSimpleTest()
**Accepting Snapshots:**
```bash
# After verifying .received.txt files are correct:
-cd TUnit.Core.SourceGenerator.Tests
+cd tests/TUnit.Core.SourceGenerator.Tests
for f in *.received.txt; do mv "$f" "${f%.received.txt}.verified.txt"; done
# Commit the .verified.txt files
@@ -785,7 +785,7 @@ public async Task BeforeAllTestsHook_ExecutesOnce(ExecutionMode mode)
### Adding Analyzer Rules
```csharp
-// TUnit.Analyzers/Rules/TestMethodMustBePublic.cs
+// src/TUnit.Analyzers/Rules/TestMethodMustBePublic.cs
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class TestMethodMustBePublicAnalyzer : DiagnosticAnalyzer
@@ -826,7 +826,7 @@ public class TestMethodMustBePublicAnalyzer : DiagnosticAnalyzer
### Adding Assertions
```csharp
-// TUnit.Assertions/Extensions/NumericAssertions.cs
+// src/TUnit.Assertions/Extensions/NumericAssertions.cs
public static class NumericAssertions
{
@@ -863,7 +863,7 @@ await Assert.That(value).IsPositive();
**Solution**:
```bash
# 1. Review the .received.txt files to see what changed
-cd TUnit.Core.SourceGenerator.Tests # or TUnit.PublicAPI
+cd tests/TUnit.Core.SourceGenerator.Tests # or tests/TUnit.PublicAPI
ls *.received.txt
# 2. If changes are intentional (you modified the generator or public API):
@@ -955,7 +955,7 @@ public void InvokeTestMethod(MethodInfo method) { }
**Diagnostic**:
```bash
# Run performance benchmarks
-cd TUnit.Performance.Tests
+cd benchmarks/TUnit.Performance.Tests
dotnet run -c Release --framework net9.0
# Profile with dotnet-trace
diff --git a/.github/scripts/process-mock-benchmarks.js b/.github/scripts/process-mock-benchmarks.js
index db452204aab..678b6658af7 100644
--- a/.github/scripts/process-mock-benchmarks.js
+++ b/.github/scripts/process-mock-benchmarks.js
@@ -416,7 +416,7 @@ This makes TUnit.Mocks compatible with **Native AOT** and **IL trimming**, while
### Source Code
-All benchmark source code is available in the [\`TUnit.Mocks.Benchmarks\`](https://github.com/thomhurst/TUnit/tree/main/TUnit.Mocks.Benchmarks) directory.
+All benchmark source code is available in the [\`TUnit.Mocks.Benchmarks\`](https://github.com/thomhurst/TUnit/tree/main/benchmarks/TUnit.Mocks.Benchmarks) directory.
---
diff --git a/.github/workflows/dotnet-build-different-locale.yml b/.github/workflows/dotnet-build-different-locale.yml
index 01eccb11a46..4a1a2a350f9 100644
--- a/.github/workflows/dotnet-build-different-locale.yml
+++ b/.github/workflows/dotnet-build-different-locale.yml
@@ -53,4 +53,4 @@ jobs:
- name: Build
run: dotnet build -c Release
- working-directory: TUnit.TestProject
+ working-directory: tests/TUnit.TestProject
diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index e6a34ac3d93..c8cd5292b4d 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -136,7 +136,7 @@ jobs:
- name: Publish AOT
shell: bash
run: >-
- dotnet publish TUnit.TestProject/TUnit.TestProject.csproj -c Release
+ dotnet publish tests/TUnit.TestProject/TUnit.TestProject.csproj -c Release
--use-current-runtime -p:Aot=true -o TESTPROJECT_AOT --framework net10.0
"-p:Version=${{ steps.gitversion.outputs.semVer }}"
"-p:AssemblyVersion=${{ steps.gitversion.outputs.assemblySemVer }}"
diff --git a/.github/workflows/mock-benchmarks.yml b/.github/workflows/mock-benchmarks.yml
index d0fa1783e47..ff7759f528e 100644
--- a/.github/workflows/mock-benchmarks.yml
+++ b/.github/workflows/mock-benchmarks.yml
@@ -30,7 +30,7 @@ jobs:
- name: Run Benchmark
run: dotnet run -c Release -f net10.0 -- --filter "*${{ matrix.benchmark }}*" --exporters json github
- working-directory: "TUnit.Mocks.Benchmarks"
+ working-directory: "benchmarks/TUnit.Mocks.Benchmarks"
- name: Upload Results
uses: actions/upload-artifact@v7
diff --git a/.gitignore b/.gitignore
index 00e1660bb63..ccc6e47387e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -416,8 +416,8 @@ requirements/
**/SourceGeneratedViewer/
# TUnit test output files
-TUnit.TestProject/TestDiscovery*.txt
-TUnit.TestProject/TestSession*.txt
+tests/TUnit.TestProject/TestDiscovery*.txt
+tests/TUnit.TestProject/TestSession*.txt
.mcp.json
requirements
diff --git a/.vscode/launch.json b/.vscode/launch.json
index fe74b4a0bd3..179219e2150 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -10,9 +10,9 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
- "program": "${workspaceFolder}/TUnit.TestProject/bin/Debug/net8.0/TUnit.TestProject.dll",
+ "program": "${workspaceFolder}/tests/TUnit.TestProject/bin/Debug/net8.0/TUnit.TestProject.dll",
"args": [],
- "cwd": "${workspaceFolder}/TUnit.TestProject",
+ "cwd": "${workspaceFolder}/tests/TUnit.TestProject",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
@@ -23,4 +23,4 @@
"request": "attach"
}
]
-}
\ No newline at end of file
+}
diff --git a/CLAUDE.md b/CLAUDE.md
index a79252faac6..0577974b927 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -22,7 +22,7 @@ See `.claude/docs/mandatory-rules.md` for full details.
**NEVER run `TUnit.TestProject` without filters.** Many tests are designed to fail.
```bash
-cd TUnit.TestProject
+cd tests/TUnit.TestProject
dotnet test --treenode-filter "/*/*/SpecificClass/*"
```
See `.claude/docs/workflows.md` for filter syntax and details.
@@ -31,7 +31,7 @@ See `.claude/docs/workflows.md` for filter syntax and details.
```bash
# Review changes, then accept if intentional:
-# (Run from test project directory, e.g., TUnit.Core.SourceGenerator.Tests)
+# (Run from test project directory, e.g., tests/TUnit.Core.SourceGenerator.Tests)
# Linux/macOS:
for f in *.received.txt; do mv "$f" "${f%.received.txt}.verified.txt"; done
diff --git a/README.md b/README.md
index e66a29bc9c0..f42b90d95fe 100644
--- a/README.md
+++ b/README.md
@@ -331,6 +331,18 @@ TUnit runs F# and VB.NET test projects too, and `TUnit.Assertions.FSharp` provid
The syntax will feel familiar. For example, xUnit's `[Fact]` becomes `[Test]`, and `[Theory]` + `[InlineData]` becomes `[Test]` + `[Arguments]`. See the migration guides for full details: [xUnit](https://tunit.dev/docs/migration/xunit) · [NUnit](https://tunit.dev/docs/migration/nunit) · [MSTest](https://tunit.dev/docs/migration/mstest).
+## Repository layout
+
+- `src/` — product libraries, analyzers, source generators, integrations, templates, and tools shipped as packages
+- `tests/` — unit, integration, snapshot, fixture, and cross-language test projects
+- `benchmarks/` — BenchmarkDotNet and profiling workloads
+- `examples/` — sample applications and test projects
+- `tools/` — repository automation and development utilities
+- `eng/` — shared MSBuild imports, signing key, and engineering assets
+- `scripts/` — local build, test, and profiling entry points
+
+Solutions and repository-wide SDK, package, and build configuration remain at root.
+
## Community
- [Documentation](https://tunit.dev) — guides, tutorials, and API reference
diff --git a/TUnit.Analyzers.Roslyn414/TUnit.Analyzers.Roslyn414.csproj b/TUnit.Analyzers.Roslyn414/TUnit.Analyzers.Roslyn414.csproj
deleted file mode 100644
index 241958b3ba5..00000000000
--- a/TUnit.Analyzers.Roslyn414/TUnit.Analyzers.Roslyn414.csproj
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/TUnit.Analyzers.Roslyn44/TUnit.Analyzers.Roslyn44.csproj b/TUnit.Analyzers.Roslyn44/TUnit.Analyzers.Roslyn44.csproj
deleted file mode 100644
index c9b05ccfa47..00000000000
--- a/TUnit.Analyzers.Roslyn44/TUnit.Analyzers.Roslyn44.csproj
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/TUnit.Analyzers.Roslyn47/TUnit.Analyzers.Roslyn47.csproj b/TUnit.Analyzers.Roslyn47/TUnit.Analyzers.Roslyn47.csproj
deleted file mode 100644
index c9b05ccfa47..00000000000
--- a/TUnit.Analyzers.Roslyn47/TUnit.Analyzers.Roslyn47.csproj
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/TUnit.AspNetCore.Analyzers.Roslyn414/TUnit.AspNetCore.Analyzers.Roslyn414.csproj b/TUnit.AspNetCore.Analyzers.Roslyn414/TUnit.AspNetCore.Analyzers.Roslyn414.csproj
deleted file mode 100644
index 73b4ec1b8c0..00000000000
--- a/TUnit.AspNetCore.Analyzers.Roslyn414/TUnit.AspNetCore.Analyzers.Roslyn414.csproj
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/TUnit.AspNetCore.Analyzers.Roslyn44/TUnit.AspNetCore.Analyzers.Roslyn44.csproj b/TUnit.AspNetCore.Analyzers.Roslyn44/TUnit.AspNetCore.Analyzers.Roslyn44.csproj
deleted file mode 100644
index 73b4ec1b8c0..00000000000
--- a/TUnit.AspNetCore.Analyzers.Roslyn44/TUnit.AspNetCore.Analyzers.Roslyn44.csproj
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/TUnit.AspNetCore.Analyzers.Roslyn47/TUnit.AspNetCore.Analyzers.Roslyn47.csproj b/TUnit.AspNetCore.Analyzers.Roslyn47/TUnit.AspNetCore.Analyzers.Roslyn47.csproj
deleted file mode 100644
index 73b4ec1b8c0..00000000000
--- a/TUnit.AspNetCore.Analyzers.Roslyn47/TUnit.AspNetCore.Analyzers.Roslyn47.csproj
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/TUnit.Aspire.Tests/TUnit.Aspire.Tests.csproj b/TUnit.Aspire.Tests/TUnit.Aspire.Tests.csproj
deleted file mode 100644
index 79eb1e29a1b..00000000000
--- a/TUnit.Aspire.Tests/TUnit.Aspire.Tests.csproj
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
- net10.0
- false
- true
- ..\strongname.snk
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/TUnit.Assertions.Should.Tests/TUnit.Assertions.Should.Tests.csproj b/TUnit.Assertions.Should.Tests/TUnit.Assertions.Should.Tests.csproj
deleted file mode 100644
index ab3c18b7545..00000000000
--- a/TUnit.Assertions.Should.Tests/TUnit.Assertions.Should.Tests.csproj
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/TUnit.Assertions.SourceGenerator.Tests/AssertionMethodGeneratorTests.GeneratesCharAssertions.DotNet8_0.verified.txt b/TUnit.Assertions.SourceGenerator.Tests/AssertionMethodGeneratorTests.GeneratesCharAssertions.DotNet8_0.verified.txt
deleted file mode 100644
index 095aec2103d..00000000000
--- a/TUnit.Assertions.SourceGenerator.Tests/AssertionMethodGeneratorTests.GeneratesCharAssertions.DotNet8_0.verified.txt
+++ /dev/null
@@ -1,524 +0,0 @@
-[
-//
-#pragma warning disable
-#nullable enable
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Threading.Tasks;
-using TUnit.Assertions.AssertConditions;
-using TUnit.Assertions.AssertConditions.Interfaces;
-using TUnit.Assertions.AssertionBuilders;
-using TUnit.Assertions.Extensions;
-
-namespace TUnit.Assertions.Extensions;
-
-public class CharIsDigitWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsDigitWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsDigit(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsDigit");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsDigit";
- }
-}
-
-public class CharIsLetterWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsLetterWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsLetter(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsLetter");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsLetter";
- }
-}
-
-public class CharIsLetterOrDigitWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsLetterOrDigitWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsLetterOrDigit(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsLetterOrDigit");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsLetterOrDigit";
- }
-}
-
-public class CharIsLowerWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsLowerWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsLower(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsLower");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsLower";
- }
-}
-
-public class CharIsUpperWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsUpperWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsUpper(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsUpper");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsUpper";
- }
-}
-
-public class CharIsNumberWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsNumberWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsNumber(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsNumber");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsNumber";
- }
-}
-
-public class CharIsPunctuationWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsPunctuationWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsPunctuation(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsPunctuation");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsPunctuation";
- }
-}
-
-public class CharIsSeparatorWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsSeparatorWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsSeparator(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsSeparator");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsSeparator";
- }
-}
-
-public class CharIsSymbolWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsSymbolWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsSymbol(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsSymbol");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsSymbol";
- }
-}
-
-public class CharIsWhiteSpaceWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsWhiteSpaceWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsWhiteSpace(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsWhiteSpace");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsWhiteSpace";
- }
-}
-
-public class CharIsControlWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsControlWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsControl(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsControl");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsControl";
- }
-}
-
-public class CharIsHighSurrogateWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsHighSurrogateWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsHighSurrogate(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsHighSurrogate");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsHighSurrogate";
- }
-}
-
-public class CharIsLowSurrogateWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsLowSurrogateWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsLowSurrogate(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsLowSurrogate");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsLowSurrogate";
- }
-}
-
-public class CharIsSurrogateWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsSurrogateWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsSurrogate(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsSurrogate");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsSurrogate";
- }
-}
-
-public static partial class CharAssertionExtensions
-{
- public static InvokableValueAssertionBuilder IsDigit(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsDigitWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotDigit(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsDigitWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsLetter(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLetterWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotLetter(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLetterWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsLetterOrDigit(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLetterOrDigitWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotLetterOrDigit(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLetterOrDigitWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsLower(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLowerWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotLower(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLowerWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsUpper(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsUpperWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotUpper(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsUpperWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNumber(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsNumberWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotNumber(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsNumberWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsPunctuation(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsPunctuationWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotPunctuation(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsPunctuationWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsSeparator(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSeparatorWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotSeparator(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSeparatorWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsSymbol(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSymbolWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotSymbol(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSymbolWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsWhiteSpace(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsWhiteSpaceWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotWhiteSpace(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsWhiteSpaceWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsControl(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsControlWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotControl(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsControlWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsHighSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsHighSurrogateWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotHighSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsHighSurrogateWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsLowSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLowSurrogateWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotLowSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLowSurrogateWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSurrogateWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSurrogateWithCharAssertCondition(true),
- []);
- }
-
-}
-
-]
\ No newline at end of file
diff --git a/TUnit.Assertions.SourceGenerator.Tests/AssertionMethodGeneratorTests.GeneratesCharAssertions.DotNet9_0.verified.txt b/TUnit.Assertions.SourceGenerator.Tests/AssertionMethodGeneratorTests.GeneratesCharAssertions.DotNet9_0.verified.txt
deleted file mode 100644
index 095aec2103d..00000000000
--- a/TUnit.Assertions.SourceGenerator.Tests/AssertionMethodGeneratorTests.GeneratesCharAssertions.DotNet9_0.verified.txt
+++ /dev/null
@@ -1,524 +0,0 @@
-[
-//
-#pragma warning disable
-#nullable enable
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Threading.Tasks;
-using TUnit.Assertions.AssertConditions;
-using TUnit.Assertions.AssertConditions.Interfaces;
-using TUnit.Assertions.AssertionBuilders;
-using TUnit.Assertions.Extensions;
-
-namespace TUnit.Assertions.Extensions;
-
-public class CharIsDigitWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsDigitWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsDigit(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsDigit");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsDigit";
- }
-}
-
-public class CharIsLetterWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsLetterWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsLetter(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsLetter");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsLetter";
- }
-}
-
-public class CharIsLetterOrDigitWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsLetterOrDigitWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsLetterOrDigit(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsLetterOrDigit");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsLetterOrDigit";
- }
-}
-
-public class CharIsLowerWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsLowerWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsLower(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsLower");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsLower";
- }
-}
-
-public class CharIsUpperWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsUpperWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsUpper(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsUpper");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsUpper";
- }
-}
-
-public class CharIsNumberWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsNumberWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsNumber(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsNumber");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsNumber";
- }
-}
-
-public class CharIsPunctuationWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsPunctuationWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsPunctuation(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsPunctuation");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsPunctuation";
- }
-}
-
-public class CharIsSeparatorWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsSeparatorWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsSeparator(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsSeparator");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsSeparator";
- }
-}
-
-public class CharIsSymbolWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsSymbolWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsSymbol(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsSymbol");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsSymbol";
- }
-}
-
-public class CharIsWhiteSpaceWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsWhiteSpaceWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsWhiteSpace(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsWhiteSpace");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsWhiteSpace";
- }
-}
-
-public class CharIsControlWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsControlWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsControl(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsControl");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsControl";
- }
-}
-
-public class CharIsHighSurrogateWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsHighSurrogateWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsHighSurrogate(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsHighSurrogate");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsHighSurrogate";
- }
-}
-
-public class CharIsLowSurrogateWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsLowSurrogateWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsLowSurrogate(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsLowSurrogate");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsLowSurrogate";
- }
-}
-
-public class CharIsSurrogateWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsSurrogateWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsSurrogate(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsSurrogate");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsSurrogate";
- }
-}
-
-public static partial class CharAssertionExtensions
-{
- public static InvokableValueAssertionBuilder IsDigit(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsDigitWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotDigit(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsDigitWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsLetter(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLetterWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotLetter(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLetterWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsLetterOrDigit(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLetterOrDigitWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotLetterOrDigit(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLetterOrDigitWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsLower(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLowerWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotLower(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLowerWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsUpper(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsUpperWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotUpper(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsUpperWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNumber(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsNumberWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotNumber(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsNumberWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsPunctuation(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsPunctuationWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotPunctuation(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsPunctuationWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsSeparator(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSeparatorWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotSeparator(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSeparatorWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsSymbol(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSymbolWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotSymbol(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSymbolWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsWhiteSpace(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsWhiteSpaceWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotWhiteSpace(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsWhiteSpaceWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsControl(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsControlWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotControl(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsControlWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsHighSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsHighSurrogateWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotHighSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsHighSurrogateWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsLowSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLowSurrogateWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotLowSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLowSurrogateWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSurrogateWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSurrogateWithCharAssertCondition(true),
- []);
- }
-
-}
-
-]
\ No newline at end of file
diff --git a/TUnit.Assertions.SourceGenerator.Tests/AssertionMethodGeneratorTests.GeneratesCharAssertions.Net4_7.verified.txt b/TUnit.Assertions.SourceGenerator.Tests/AssertionMethodGeneratorTests.GeneratesCharAssertions.Net4_7.verified.txt
deleted file mode 100644
index 095aec2103d..00000000000
--- a/TUnit.Assertions.SourceGenerator.Tests/AssertionMethodGeneratorTests.GeneratesCharAssertions.Net4_7.verified.txt
+++ /dev/null
@@ -1,524 +0,0 @@
-[
-//
-#pragma warning disable
-#nullable enable
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Threading.Tasks;
-using TUnit.Assertions.AssertConditions;
-using TUnit.Assertions.AssertConditions.Interfaces;
-using TUnit.Assertions.AssertionBuilders;
-using TUnit.Assertions.Extensions;
-
-namespace TUnit.Assertions.Extensions;
-
-public class CharIsDigitWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsDigitWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsDigit(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsDigit");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsDigit";
- }
-}
-
-public class CharIsLetterWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsLetterWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsLetter(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsLetter");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsLetter";
- }
-}
-
-public class CharIsLetterOrDigitWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsLetterOrDigitWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsLetterOrDigit(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsLetterOrDigit");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsLetterOrDigit";
- }
-}
-
-public class CharIsLowerWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsLowerWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsLower(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsLower");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsLower";
- }
-}
-
-public class CharIsUpperWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsUpperWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsUpper(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsUpper");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsUpper";
- }
-}
-
-public class CharIsNumberWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsNumberWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsNumber(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsNumber");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsNumber";
- }
-}
-
-public class CharIsPunctuationWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsPunctuationWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsPunctuation(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsPunctuation");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsPunctuation";
- }
-}
-
-public class CharIsSeparatorWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsSeparatorWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsSeparator(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsSeparator");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsSeparator";
- }
-}
-
-public class CharIsSymbolWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsSymbolWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsSymbol(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsSymbol");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsSymbol";
- }
-}
-
-public class CharIsWhiteSpaceWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsWhiteSpaceWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsWhiteSpace(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsWhiteSpace");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsWhiteSpace";
- }
-}
-
-public class CharIsControlWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsControlWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsControl(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsControl");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsControl";
- }
-}
-
-public class CharIsHighSurrogateWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsHighSurrogateWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsHighSurrogate(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsHighSurrogate");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsHighSurrogate";
- }
-}
-
-public class CharIsLowSurrogateWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsLowSurrogateWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsLowSurrogate(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsLowSurrogate");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsLowSurrogate";
- }
-}
-
-public class CharIsSurrogateWithCharAssertCondition : BaseAssertCondition
-{
- private readonly bool _negated;
-
- public CharIsSurrogateWithCharAssertCondition(bool negated = false)
- {
- _negated = negated;
- }
-
- protected override ValueTask GetResult(char actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- var result = char.IsSurrogate(actualValue);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy IsSurrogate");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy IsSurrogate";
- }
-}
-
-public static partial class CharAssertionExtensions
-{
- public static InvokableValueAssertionBuilder IsDigit(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsDigitWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotDigit(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsDigitWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsLetter(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLetterWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotLetter(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLetterWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsLetterOrDigit(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLetterOrDigitWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotLetterOrDigit(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLetterOrDigitWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsLower(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLowerWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotLower(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLowerWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsUpper(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsUpperWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotUpper(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsUpperWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNumber(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsNumberWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotNumber(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsNumberWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsPunctuation(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsPunctuationWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotPunctuation(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsPunctuationWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsSeparator(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSeparatorWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotSeparator(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSeparatorWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsSymbol(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSymbolWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotSymbol(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSymbolWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsWhiteSpace(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsWhiteSpaceWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotWhiteSpace(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsWhiteSpaceWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsControl(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsControlWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotControl(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsControlWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsHighSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsHighSurrogateWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotHighSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsHighSurrogateWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsLowSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLowSurrogateWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotLowSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsLowSurrogateWithCharAssertCondition(true),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSurrogateWithCharAssertCondition(false),
- []);
- }
-
- public static InvokableValueAssertionBuilder IsNotSurrogate(this IValueSource valueSource)
- {
- return valueSource.RegisterAssertion(
- new CharIsSurrogateWithCharAssertCondition(true),
- []);
- }
-
-}
-
-]
\ No newline at end of file
diff --git a/TUnit.Assertions.SourceGenerator.Tests/AssertionMethodGeneratorTests.GeneratesEnumAssertions.DotNet8_0.verified.txt b/TUnit.Assertions.SourceGenerator.Tests/AssertionMethodGeneratorTests.GeneratesEnumAssertions.DotNet8_0.verified.txt
deleted file mode 100644
index 3428231e99e..00000000000
--- a/TUnit.Assertions.SourceGenerator.Tests/AssertionMethodGeneratorTests.GeneratesEnumAssertions.DotNet8_0.verified.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-[
-//
-#pragma warning disable
-#nullable enable
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Threading.Tasks;
-using TUnit.Assertions.AssertConditions;
-using TUnit.Assertions.AssertConditions.Interfaces;
-using TUnit.Assertions.AssertionBuilders;
-using TUnit.Assertions.Extensions;
-
-namespace TUnit.Assertions.Extensions;
-
-public class EnumHasFlagWithEnumAssertCondition : BaseAssertCondition
-{
- private readonly System.Enum _flag;
- private readonly bool _negated;
-
- public EnumHasFlagWithEnumAssertCondition(System.Enum flag, bool negated = false)
- {
- _flag = flag;
- _negated = negated;
- }
-
- protected override ValueTask GetResult(System.Enum? actualValue, Exception? exception, AssertionMetadata assertionMetadata)
- {
- if (actualValue is null)
- {
- return AssertionResult.Fail("Actual value is null");
- }
-
- var result = actualValue.HasFlag(_flag);
- var condition = _negated ? result : !result;
- return AssertionResult.FailIf(condition, $"'{actualValue}' was expected {(_negated ? "not " : "")}to satisfy HasFlag({_flag})");
- }
-
- protected internal override string GetExpectation()
- {
- return $"{(_negated ? "not " : "")}to satisfy HasFlag({_flag})";
- }
-}
-
-public static partial class EnumAssertionExtensions
-{
- public static InvokableValueAssertionBuilder