Skip to content

test: consolidate and standardize test suite on develop/1.0#151

Merged
petesramek merged 9 commits intodevelop/1.0from
copilot/review-and-consolidate-tests
Apr 3, 2026
Merged

test: consolidate and standardize test suite on develop/1.0#151
petesramek merged 9 commits intodevelop/1.0from
copilot/review-and-consolidate-tests

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 3, 2026

  • Fix stale XML comments and restore PolylineEncoderBenchmark (previous commit)
  • Add AbstractPolylineEncoderTests.cs — constructor paths, Encode valid/empty/cancelled, heap-alloc path, Options property
  • Add PolylineEncoderExtensionsTests.cs — List and Array overloads (null encoder, null coordinates, valid)
  • Expand AbstractPolylineDecoderTests.cs — valid decode, options constructor null check, Options property, custom options, cancellation
  • Add InvalidPolylineExceptionTests.cs — default constructor and message+innerException constructor
  • All 214 tests pass, build clean, CodeQL: 0 alerts

- Remove unused Moq package reference
- Fix blank lines between [TestMethod] and public void (artifacts of previously removed [TestCategory] attributes) in ExceptionGuardTests, PolylineEncodingTests, CoordinateDeltaTests, Pow10Tests
- Consolidate Pow10Tests: 13 individual tests -> 2 data-driven [DataRow] methods
- Consolidate CoordinateDeltaTests: 8+ repeated Next/ToString tests -> 3 DataRow methods covering all input combinations
- Consolidate PolylineEncodingTests (1424 -> 681 lines): Normalize non-finite, Normalize value, Denormalize value, GetRequiredBufferSize, ValidateCharRange, ValidateBlockLength all converted to [DataRow]
- Add XML doc comments to LogDebugExtensionsTests and LogWarningExtensionsTests methods
- Rewrite AbstractPolylineDecoderTests: add copyright header, file-scoped namespace, XML docs, explicit types
- Add using System.Globalization to CoordinateDeltaTests

Agent-Logs-Url: https://github.com/petesramek/polyline-algorithm-csharp/sessions/2ffb0731-b271-46b2-8126-78f2f97d1f21

Co-authored-by: petesramek <2333452+petesramek@users.noreply.github.com>
… CancellationToken

- Remove duplicate `using PolylineAlgorithm.Internal.Diagnostics;`
- Add `using System.Threading;`
- Add `CancellationToken cancellationToken` parameter to `Encode` matching `IPolylineEncoder` interface
- Add `cancellationToken.ThrowIfCancellationRequested()` at the top of the encoding for-loop

Agent-Logs-Url: https://github.com/petesramek/polyline-algorithm-csharp/sessions/7d5e58df-8d5f-42e0-8f6d-5dbdcf138bc1

Co-authored-by: petesramek <2333452+petesramek@users.noreply.github.com>
Copilot AI and others added 2 commits April 3, 2026 14:54
…lylineDecoder

IPolylineDecoder already has cancellationToken = default, making the no-token
overload unnecessary. Callers can call Decode(polyline) directly via the interface.

Agent-Logs-Url: https://github.com/petesramek/polyline-algorithm-csharp/sessions/0ad5e8c4-b82b-4f8c-805d-29afa8c45722

Co-authored-by: petesramek <2333452+petesramek@users.noreply.github.com>
Avoids breaking existing callers that use the concrete class directly.
Only one Encode overload exists so there is no RS0026 concern.

Agent-Logs-Url: https://github.com/petesramek/polyline-algorithm-csharp/sessions/0ad5e8c4-b82b-4f8c-805d-29afa8c45722

Co-authored-by: petesramek <2333452+petesramek@users.noreply.github.com>
…ylineDecoder, fix typo in AbstractPolylineEncoder, add default CancellationToken to Decode

- Restore Coordinate.cs and Polyline.cs accidentally deleted in the 241880e commit
- Remove invalid 'using PolylineAlgorithm.Diagnostics' and duplicate using from AbstractPolylineDecoder
- Fix typo ThrwoArgumentCannotBeEmptyEnumerationMessage -> ThrowArgumentCannotBeEmptyEnumerationMessage
- Add = default to AbstractPolylineDecoder.Decode cancellationToken to restore source compatibility

Agent-Logs-Url: https://github.com/petesramek/polyline-algorithm-csharp/sessions/05118682-83dd-4b46-adee-22711f38696f

Co-authored-by: petesramek <2333452+petesramek@users.noreply.github.com>
…ineDecoderExtensions.cs

These files were intentionally deleted as part of moving to a fully generic decoder/encoder design.
The previous session incorrectly restored them. PolylineDecoderExtensions.cs was also removed as
it depended on the now-deleted Polyline/Coordinate types and was itself deleted in the same checkpoint.

Agent-Logs-Url: https://github.com/petesramek/polyline-algorithm-csharp/sessions/8b6c08fb-689d-42ed-8c5c-1771cce57444

Co-authored-by: petesramek <2333452+petesramek@users.noreply.github.com>
- Replace <see cref="Coordinate"/> and <see cref="Polyline"/> references in
  RandomValueProvider.cs and StaticValueProvider.cs with plain descriptions
  (those types no longer exist)
- Add missing <param name="cancellationToken"> tag in AbstractPolylineEncoder.Encode
  (fixes CS1573 warning)
- Uncomment and rewrite PolylineEncoderBenchmark.cs: add StringPolylineEncoder
  inner class, fix broken _encoder references in Span/Array/List benchmarks,
  align with IPolylineEncoder<TCoordinate, TPolyline> generic API

Agent-Logs-Url: https://github.com/petesramek/polyline-algorithm-csharp/sessions/cd24bd09-954c-4853-95b0-1d634853b58a

Co-authored-by: petesramek <2333452+petesramek@users.noreply.github.com>
…olylineException

- Add AbstractPolylineEncoderTests: default ctor, null-options, Options property,
  Encode valid/empty/cancelled, heap-alloc path (stackAllocLimit=1)
- Add PolylineEncoderExtensionsTests: List and Array overloads (null encoder,
  null coordinates, valid encode); use explicit static call for array null checks
  since T[] → ReadOnlySpan<T> implicit conversion makes the instance method win
- Add InvalidPolylineExceptionTests: default ctor and message+innerException ctor
- Extend AbstractPolylineDecoderTests: valid decode with known coordinates, null
  options ctor, Options property, custom options, cancellation
- Fix minor capitalization in PolylineEncodingTests comment (code review feedback)

Agent-Logs-Url: https://github.com/petesramek/polyline-algorithm-csharp/sessions/8e2d22ca-9372-4d0a-8f6c-9c1a7a8fd66a

Co-authored-by: petesramek <2333452+petesramek@users.noreply.github.com>
@petesramek petesramek marked this pull request as ready for review April 3, 2026 16:11
@petesramek petesramek merged commit bd09d87 into develop/1.0 Apr 3, 2026
1 check passed
@petesramek petesramek deleted the copilot/review-and-consolidate-tests branch April 3, 2026 21:16
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.

2 participants