Skip to content

style: idiomatic cleanups in mid-size test files - #421

Merged
twcclegg merged 1 commit into
mainfrom
style/test-medium-suite
Aug 26, 2026
Merged

style: idiomatic cleanups in mid-size test files#421
twcclegg merged 1 commit into
mainfrom
style/test-medium-suite

Conversation

@twcclegg

Copy link
Copy Markdown
Owner

Summary

Part of the ongoing idiomatic-C# cleanup sweep (see #409, #412-#419). Very conservative pass over 10 mid-size files in PhoneNumbers.Test/: TestBuildMetadataFromXml.cs, TestShortNumberInfo.cs, TestPhoneNumberToCarrierMapper.cs, TestPhoneNumberToTimeZonesMapper.cs, TestPublicApiRobustness.cs, TestPhoneNumberOfflineGeocoder.cs, TestAreaCodeMap.cs, TestPhoneNumberProperties.cs, TestBuildPrefixMapFromBin.cs, TestExampleNumbers.cs.

Most of these are near line-by-line ports of upstream Google Java test suites, so this PR intentionally only touches non-assertion helper/setup code — no assertion logic, test data, expected values, or method structure changed. Only 3 files had anything to change:

  • TestPublicApiRobustness.cs, TestPhoneNumberProperties.cs, TestExampleNumbers.cs: == null/!= null guard clauses → is null/is not null.

The other 7 files were reviewed and left untouched — nothing outside an Assert.* call was a safe, unambiguous win.

Test plan

  • dotnet build csharp/PhoneNumbers.slnx — 0 warnings, 0 errors
  • dotnet test csharp/PhoneNumbers.Test/PhoneNumbers.Test.csproj — 414/414 passing on net8.0 and net10.0 (same count as before)

Convert == null / != null guard clauses to is null / is not null in
non-assertion helper code across TestPublicApiRobustness.cs,
TestPhoneNumberProperties.cs, and TestExampleNumbers.cs. No assertion
logic, test data, or expected values touched.
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.42%. Comparing base (e75ae83) to head (7e3f06a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #421   +/-   ##
=======================================
  Coverage   87.42%   87.42%           
=======================================
  Files          41       41           
  Lines        3856     3856           
  Branches      990      990           
=======================================
  Hits         3371     3371           
  Misses        283      283           
  Partials      202      202           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant