Skip to content

[repo-assist] test: add Parse/TryParse and Round invalid-mode coverage - #216

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/test-parse-round-2026-07-06-851e9d135ef56e29
Draft

[repo-assist] test: add Parse/TryParse and Round invalid-mode coverage#216
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/test-parse-round-2026-07-06-851e9d135ef56e29

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Adds 24 new tests covering Parse, TryParse, and Round with an invalid MidpointRounding mode — all of which previously had zero test coverage.

Background

A code-coverage audit found that the entire Parse/TryParse API surface was untested. These are important entry points: they accept string, ReadOnlySpan<char>, string?, and various NumberStyles/IFormatProvider overloads, plus error paths. The Round method's guard for an unsupported MidpointRounding enum value was also untested.

New file: FixedPointNanoParseTests.cs

Test category Count
Parse(string) — happy-path values 6
Parse(ReadOnlySpan<char>) 2
Parse with explicit NumberStyles / culture 3
Parse invalid input → FormatException 3
TryParse(string, out) — valid + invalid + null 4
TryParse(ReadOnlySpan<char>, out) 2
TryParse with NumberStyles / culture 2
Round — invalid MidpointRounding mode 2
Total 24

Test Status

dotnet build FixedPointNano.slnx -c Release
Build succeeded. 0 Warning(s), 0 Error(s)

dotnet test tests/FixedPointNano.Tests -c Release
Passed! - Failed: 0, Passed: 1450, Skipped: 0, Total: 1450

Build: ✅ Tests: ✅ (1426 → 1450, +24 new tests, 0 failures)

Generated by 🤖 Repo Assist — workflow run.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

Add this agentic workflows to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@e15e57b40918dbca11b350c55d02ab61934afa75

Adds FixedPointNanoParseTests.cs with 24 tests covering:
- Parse(string) with valid, negative, and zero values
- Parse(string) throws FormatException on invalid input
- Parse(string) throws ArgumentNullException for null
- Parse(ReadOnlySpan<char>) valid and invalid cases
- TryParse(string?, IFormatProvider, out) — true/false cases including null, invalid, and out-of-range values
- TryParse(string?, out) — invariant culture shorthand
- TryParse(ReadOnlySpan<char>, IFormatProvider, out) — valid and invalid
- TryParse(ReadOnlySpan<char>, out) — invariant culture shorthand
- Round with invalid MidpointRounding mode throws ArgumentOutOfRangeException
- Parse/TryParse round-trip with 6 test case values

1426 → 1450 tests passing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants