Skip to content

feat: add expectations on Uri#89

Merged
vbreuss merged 1 commit intomainfrom
topic/add-uri-tests
Sep 14, 2025
Merged

feat: add expectations on Uri#89
vbreuss merged 1 commit intomainfrom
topic/add-uri-tests

Conversation

@vbreuss
Copy link
Copy Markdown
Member

@vbreuss vbreuss commented Sep 14, 2025

This PR adds Uri expectations to the aweXpect.Web library, introducing several extension methods to validate various Uri properties and states.

Key changes

  • Added Uri-specific assertion methods for absolute, file, loopback, and UNC path validation
    • ThatUri.Is{Not}Absolute()
    • ThatUri.Is{Not}File()
    • ThatUri.Is{Not}Loopback()
    • ThatUri.Is{Not}Unc()
  • Added port validation methods for checking default port usage
    • ThatUri.HasDefaultPort() / ThatUri.DoesNotHaveDefaultPort()
  • See also feat: add expectations on Uri aweXpect#782

@vbreuss vbreuss self-assigned this Sep 14, 2025
Copilot AI review requested due to automatic review settings September 14, 2025 07:56
@vbreuss vbreuss added the enhancement New feature or request label Sep 14, 2025
Copy link
Copy Markdown

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 adds Uri expectations to the aweXpect.Web library, introducing several extension methods to validate various Uri properties and states.

  • Adds new ThatUri static class with extensions for Uri validation
  • Implements validation methods for Uri properties like IsUnc, IsLoopback, IsFile, IsAbsolute, and HasDefaultPort
  • Includes both positive and negative assertion variants for each validation method

Reviewed Changes

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

Show a summary per file
File Description
Source/aweXpect.Web/ThatUri.cs Main class declaration for Uri expectations
Source/aweXpect.Web/ThatUri.*.cs Individual constraint implementations for each Uri validation method
Tests/aweXpect.Web.Tests/ThatUri*.Tests.cs Comprehensive test coverage for all Uri validation methods
Tests/aweXpect.Web.Api.Tests/Expected/*.txt Updated API surface area documentation
Directory.Packages.props Updated aweXpect.Core dependency version

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

Test Results

   10 files  ±  0     10 suites  ±0   6s ⏱️ -1s
  544 tests + 60    543 ✅ + 60  1 💤 ±0  0 ❌ ±0 
1 620 runs  +180  1 619 ✅ +180  1 💤 ±0  0 ❌ ±0 

Results for commit 9fc8c5f. ± Comparison against base commit 80a0f9c.

@github-actions
Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.14.0, Ubuntu 24.04.3 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.305
[Host] : .NET 8.0.20 (8.0.2025.41914), X64 RyuJIT AVX2
DefaultJob : .NET 8.0.20 (8.0.2025.41914), X64 RyuJIT AVX2

Method Mean Error StdDev Gen0 Allocated
Content_aweXpect 594.5 ns 7.24 ns 6.05 ns 0.0648 1096 B
SuccessStatusCode_aweXpect 323.2 ns 2.96 ns 2.77 ns 0.0515 864 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 Total Detected Total Undetected Total Mutants
ThatUri.HasDefaultPort.cs 100.00% 7 0 0 0 2 4 7 0 13
ThatUri.IsAbsolute.cs 100.00% 7 0 0 0 2 4 7 0 13
ThatUri.IsFile.cs 100.00% 7 0 0 0 2 4 7 0 13
ThatUri.IsLoopback.cs 100.00% 7 0 0 0 2 4 7 0 13
ThatUri.IsUnc.cs 100.00% 7 0 0 0 2 4 7 0 13

The final mutation score is 100.00%

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

@vbreuss vbreuss merged commit 16c5e60 into main Sep 14, 2025
12 checks passed
@vbreuss vbreuss deleted the topic/add-uri-tests branch September 14, 2025 08:01
@github-actions
Copy link
Copy Markdown

This is addressed in release v1.6.0.

@github-actions github-actions Bot added the state: released The issue is released label Oct 19, 2025
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.

2 participants