• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jas88 / TypeGuesser / 19487816419
90%

Build:
DEFAULT BRANCH: main
Ran 19 Nov 2025 02:39AM UTC
Jobs 1
Files 24
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Nov 2025 02:37AM UTC coverage: 89.291% (+0.2%) from 89.097%
19487816419

push

github

web-flow
Fix DatabaseTypeRequest.Equals to use type-specific semantics (#20)

## Summary

Fixes #19 - `DatabaseTypeRequest.Equals()` now uses type-specific
equality semantics, comparing only the properties that are semantically
meaningful for each SQL type.

## Problem

Previously, `Equals()` compared all properties (`CSharpType`, `Width`,
`Size`, `Unicode`) regardless of type, causing false negatives when
comparing semantically equivalent objects:

- Guesser-created: `DatabaseTypeRequest(decimal, Width=4,
Size=DecimalSize(4,1))`
- SQL reverse-engineered: `DatabaseTypeRequest(decimal, Width=null,
Size=DecimalSize(4,1))`

These represent the same `DECIMAL(5,1)` type but were considered **not
equal** due to different `Width` values.

## Solution

Updated `Equals()` to compare only relevant properties per type:

| Type | Compared Properties | Ignored Properties |
|------|--------------------|--------------------|
| **decimal** | `CSharpType`, `Size` (precision/scale) | `Width`,
`Unicode` |
| **string** | `CSharpType`, `_maxWidthForStrings`, `Unicode` | `Size` |
| **byte[]** | `CSharpType`, `_maxWidthForStrings` | `Size`, `Unicode` |
| **Other types** | `CSharpType` only | `Width`, `Size`, `Unicode` |

*Other types: bool, byte, short, int, long, float, double, DateTime,
TimeSpan, Guid (fixed SQL storage sizes)*

## Changes

- **TypeGuesser/DatabaseTypeRequest.cs**:
  - Updated `Equals()` with type-specific comparison logic
  - Updated `GetHashCode()` to match new equality semantics
- Fixed to use `_maxWidthForStrings` backing field instead of computed
`Width` property (Copilot feedback)
  - Added comprehensive XML documentation

- **Tests/DatabaseTypeRequestEnhancedTests.cs**:
  - Added 19 new tests covering all type-specific equality cases
  - Tests include round-trip scenario from issue #19
  - Tests include edge cases identified by Copilot AI review

- **CHANGELOG.md**:
  - Documented fix in v2.0.2 section

## Test Results

✅ **All 396 tests pass**  
✅ **0 warn... (continued)

456 of 548 branches covered (83.21%)

Branch coverage included in aggregate %.

23 of 23 new or added lines in 1 file covered. (100.0%)

1295 of 1413 relevant lines covered (91.65%)

191133.63 hits per line

Jobs
ID Job ID Ran Files Coverage
1 19487816419.1 19 Nov 2025 02:39AM UTC 24
89.29
GitHub Action Run
Source Files on build 19487816419
  • Tree
  • List 24
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #19487816419
  • fffd41ae on github
  • Prev Build on main (#19487111794)
  • Next Build on main (#19488090211)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc