Skip to content

Add comprehensive test suite for Program.Code() encoding/decoding method - #43

Merged
tuduce merged 3 commits into
mainfrom
copilot/add-tests-for-program-code
Dec 4, 2025
Merged

tuduce merged 3 commits into
mainfrom
copilot/add-tests-for-program-code

Conversation

Copilot AI commented Dec 4, 2025 •

Copy link
Copy Markdown

The Program.Code() method implements a bidirectional Caesar cipher with pseudo-random key-based encoding but lacked test coverage.

Changes

  • Created JoinFS.Tests project with xUnit framework targeting .NET 8.0

    • Platform-independent (net8.0 vs net8.0-windows) to support cross-platform CI/CD
    • Added standalone copy of Program.Code() to avoid Windows Forms dependencies
  • Implemented 34 test cases covering:

    • Round-trip encoding/decoding verification
    • Key sensitivity and deterministic behavior
    • Edge cases (null, empty, invalid characters, boundary conditions)
    • Real-world scenarios (URLs, file paths, long strings)
    • Character range validation (printable ASCII '!' to '~')
  • Repository configuration

    • Added test project to solution
    • Updated .gitignore for test artifacts

Example Test

[Theory]
[InlineData("Hello World")]
[InlineData("https://example.com")]
[InlineData("Path/To/File.txt")]
public void Code_RoundTrip_RestoresOriginalString(string original)
{
    string encoded = ProgramCode.Code(original, true, TestKey);
    string decoded = ProgramCode.Code(encoded, false, TestKey);
    
    Assert.NotEqual(original, encoded);
    Assert.Equal(original, decoded);
}

All 34 tests pass (Duration: ~55ms).

Original prompt

Write tests for Program.Code(...).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 4, 2025 15:16
- Created JoinFS.Tests project with 34 comprehensive unit tests
- Tests cover encoding, decoding, round-trips, edge cases, and key sensitivity
- All tests pass successfully
- Added test project to solution
- Documented test coverage in README

Co-authored-by: tuduce <73273884+tuduce@users.noreply.github.com>
Co-authored-by: tuduce <73273884+tuduce@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tests for Program.Code method Add comprehensive test suite for Program.Code() encoding/decoding method Dec 4, 2025
Copilot AI requested a review from tuduce December 4, 2025 15:19
@tuduce
tuduce marked this pull request as ready for review December 4, 2025 15:21
@tuduce
tuduce merged commit a8dda9c into main Dec 4, 2025

@tuduce tuduce left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@tuduce
tuduce deleted the copilot/add-tests-for-program-code branch June 7, 2026 13:35
joeherwig pushed a commit to joeherwig/JoinFS that referenced this pull request Jul 13, 2026
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