Initial development#1
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request represents the initial development of a .NET library providing extension methods for types implementing IComparable. The PR transforms the repository from a template into a working project with comprehensive multi-framework support, examples, and CI/CD infrastructure.
Changes:
- Adds
IsBetweenandIsInRangeextension methods for IComparable types with comprehensive unit tests - Configures multi-framework targeting (.NET Framework 4.6.2-4.8.1, .NET Standard 2.0, .NET 5.0-9.0)
- Implements enhanced CI/CD workflows with staged testing, coverage gating (90% threshold), and security scanning
Reviewed changes
Copilot reviewed 17 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Wolfgang.Extensions.IComparable/Wolfgang.Extensions.IComparable.csproj | Main library project configuration with multi-framework targeting and NuGet package metadata |
| src/Wolfgang.Extensions.IComparable/IComparableExtensions.cs | Core extension methods (IsBetween, IsInRange) for IComparable types |
| src/Wolfgang.Extensions.IComparable/icon.ico | Package icon for NuGet |
| tests/Wolfgang.Extensions.IComparable.Tests.Unit/Wolfgang.Extensions.IComparable.Tests.Unit.csproj | Test project with extensive framework coverage |
| tests/Wolfgang.Extensions.IComparable.Tests.Unit/IComparableExtensionsTests.cs | Comprehensive unit tests covering integers, dates, strings, and chars |
| examples/Wolfgang.Extensions.IComparable.DotNet8.Example1/* | .NET 8.0 console example demonstrating extension method usage |
| examples/Wolfgang.Extensions.IComparable.DotNet462.Example1/* | .NET Framework 4.6.2 example project |
| README.md | Updated project description |
| .gitignore | Added test results and coverage report exclusions |
| .github/workflows/pr.yaml | Enhanced PR validation with 3-stage testing and coverage gating |
| .github/workflows/release.yaml | Updated release workflow for Windows-only builds |
| .github/workflows/docfx.yaml | Updated documentation build workflow |
| .github/workflows/create-labels.yaml | Enhanced label creation with better error handling |
| assets/icon.png | Package icon asset |
…rable.csproj Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| { | ||
| } | ||
| } |
There was a problem hiding this comment.
The Main method is empty and does not demonstrate the usage of the IComparable extension methods. This example project should contain actual demonstration code similar to the DotNet8.Example1 project, or it should be removed as it provides no value to users.
| { | |
| } | |
| } | |
| { | |
| int value = 5; | |
| int lower = 1; | |
| int upper = 10; | |
| bool isBetweenInts = value.IsBetween(lower, upper); | |
| Console.WriteLine($"{value} is between {lower} and {upper}: {isBetweenInts}"); | |
| int otherValue = 7; | |
| Console.WriteLine($"{value} < {otherValue}: {value.IsLessThan(otherValue)}"); | |
| Console.WriteLine($"{value} > {otherValue}: {value.IsGreaterThan(otherValue)}"); | |
| string text = "m"; | |
| string textLower = "a"; | |
| string textUpper = "z"; | |
| bool isBetweenStrings = text.IsBetween(textLower, textUpper); | |
| Console.WriteLine($"\"{text}\" is between \"{textLower}\" and \"{textUpper}\": {isBetweenStrings}"); | |
| } | |
| } | |
| internal static class ComparableExtensions | |
| { | |
| public static bool IsBetween<T>(this T value, T min, T max) | |
| where T : IComparable<T> | |
| { | |
| if (value == null) | |
| { | |
| throw new ArgumentNullException(nameof(value)); | |
| } | |
| return value.CompareTo(min) >= 0 && value.CompareTo(max) <= 0; | |
| } | |
| public static bool IsLessThan<T>(this T value, T other) | |
| where T : IComparable<T> | |
| { | |
| if (value == null) | |
| { | |
| throw new ArgumentNullException(nameof(value)); | |
| } | |
| return value.CompareTo(other) < 0; | |
| } | |
| public static bool IsGreaterThan<T>(this T value, T other) | |
| where T : IComparable<T> | |
| { | |
| if (value == null) | |
| { | |
| throw new ArgumentNullException(nameof(value)); | |
| } | |
| return value.CompareTo(other) > 0; | |
| } | |
| } |
| <ItemGroup Condition=" | ||
| '$(TargetFramework)' == 'net8.0' or | ||
| '$(TargetFramework)' == 'net9.0' or | ||
| '$(TargetFramework)' == 'net10.0' | ||
| "> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" /> | ||
| <PackageReference Include="xunit.runner.visualstudio" Version="3.0.0"> |
There was a problem hiding this comment.
The conditional package references for .NET 8.0-10.0 specify xunit.runner.visualstudio version 3.0.0, but this version may not be compatible with .NET 10.0 since .NET 10.0 does not exist yet. Once .NET 10.0 is removed from the target frameworks, this comment can be ignored, but the versioning strategy should be reviewed to ensure compatibility.
| # Wolfgang.Extensions.IComparable | ||
|
|
||
| This repository is intended to be used as a template for creating other repositories. | ||
| A collection of extension methods for the `IComparable` struct in C#. | ||
|
|
||
| ## Methods |
There was a problem hiding this comment.
The README.md file is incomplete. It contains only a title and a "Methods" heading with no actual content. Users need documentation explaining what the library does, how to install it, and how to use the IsBetween and IsInRange extension methods with examples.
| echo "" | ||
|
|
||
| failed_projects="" | ||
| threshold=90 |
There was a problem hiding this comment.
The coverage threshold is set to 90%, but according to the repository template guidelines, the minimum required coverage is 80%. This higher threshold may be intentional, but it deviates from the documented template standard and could cause unnecessary build failures.
| <Copyright>Copyright 2026 Chris Wolfgang </Copyright> | ||
| <PackageProjectUrl>https://github.com/Chris-Wolfgang/Wolfgang.Extensions.IComparable</PackageProjectUrl> | ||
| <PackageReadmeFile>README.md</PackageReadmeFile> | ||
| <AssemblyVersion>1.0.0</AssemblyVersion> |
There was a problem hiding this comment.
The package version is set to "0.1.0-rc1" (release candidate), but the AssemblyVersion is set to "1.0.0". This version mismatch could cause confusion. The AssemblyVersion should typically match the major version of the package version, or both should use the same version number for consistency.
| <AssemblyVersion>1.0.0</AssemblyVersion> | |
| <AssemblyVersion>0.1.0</AssemblyVersion> |
Description
Fixes/Complete # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Checklist
Screenshots (if applicable)
Additional context