**Enhancements to Redis Integration and Testing**
- **RedisService.cs**:
- Implemented a Redis service for storing and retrieving authentication tokens.
- Added methods for saving, retrieving, and removing tokens using Redis.
- Introduced a constructor for dependency injection to facilitate testing.
- **RedisFixture.cs**:
- Created a test fixture to ensure a Redis instance is available for integration tests.
- Implemented a check to verify if Redis is running before executing tests.
- **ProgramRedisIntegrationTests.cs**:
- Added integration tests to validate the login process and token storage in Redis.
- Implemented tests to check the reuse of stored tokens and the correct handling of authentication.
- **RedisIntegrationTests.cs**:
- Developed integration tests for saving, retrieving, and deleting authentication tokens in Redis.
- Ensured that all tokens are correctly stored and can be retrieved as expected.
- **RedisServiceTests.cs**:
- Created unit tests using an in-memory implementation of the Redis service for isolated testing.
- Validated the functionality of saving, retrieving, and removing tokens without a real Redis connection.
### Notes
- All tests are designed to ensure the reliability of the Redis integration and the overall functionality of the VRCAuthProxy service.
- Integration tests are marked to skip execution unless a Redis instance is available.
- **docker-compose.yml**
- Added Redis service configuration to support token storage.
- Set up health checks and volume for Redis persistence.
- Configured VRCAuthProxy service to depend on Redis.
- **HttpClientCookieContainer.cs**
- Added `Username` property to support user-specific token management.
- **Program.cs**
- Integrated Redis for storing and retrieving authentication tokens.
- Updated login and token rotation logic to utilize Redis.
- Improved async/await usage for better reliability.
- **VRCAuthProxy.csproj**
- Added `StackExchange.Redis` package for Redis connectivity.
- Corrected `Otp.NET` package reference.
- **API.cs**
- Updated `TotpVerifyResponse` and `User` classes to be nullable-aware.
- **RedisService.cs**
- Implemented Redis service for managing authentication tokens.
- Added methods for saving, retrieving, and deleting tokens.
- **TestSetup.cs**
- Updated `CreateTestConfig` method to initialize `Config` with required properties using object initializer syntax.
- **ProxyIntegrationTests.cs**
- Added null checks for `mockServer.Urls` before accessing it to prevent potential null reference exceptions.
- Improved error handling for mock server URL access.
- **VRChatAuthenticationTests.cs**
- Added null checks for `mockServer.Urls` before accessing it to prevent potential null reference exceptions.
- Enhanced the mock server setup to include null checks for request body content.
- **Config.cs**
- Added the `required` modifier to non-nullable properties in `ConfigAccount` and `iConfig` classes.
- Updated the `Load` method to initialize the `Config` instance with required properties using object initializer syntax.
- **Program.cs**
- Added a null check for `result.CloseStatus` in WebSocket handling to prevent potential null reference exceptions.
- Updated the build workflow to trigger on version tags (e.g., v1.0.0) pushed to the main branch.
- Configured the Docker image to be tagged with the version and pushed to the GitHub Container Registry.
- Ensured that the workflow continues to build on pushes to the develop branch and supports manual triggering.
- Added a version badge to indicate the current version of the project.
- Included a dependencies badge to show the status of project dependencies.
- Added a license badge to clarify the licensing of the project.
chore(ci): Update test workflow to improve coverage reporting
- Updated the test.yml workflow to include coverage reporting using Codecov.
- Ensured that the workflow runs on pushes and pull requests to main and develop branches.
Add comprehensive test automation setup with GitHub Actions:
- Create test.yml for running tests on main/develop branches
- Add pr-test.yml for PR validation with test results comments
- Add update-badges.yml for dynamic test status badge updates
- Configure code coverage reporting with Codecov integration
Documentation:
- Add BADGE_SETUP.md with instructions for configuring test status badges
- Add WORKFLOWS_GUIDE.md explaining CI/CD workflow setup
- Update README.md with build and test status badges
Test Framework:
- Configure test project to use .NET 9.0
- Set up test coverage reporting with coverlet
- Add integration tests with WireMock for API mocking
- Add unit tests for configuration and HTTP client components
- Document testing strategy in TestingStrategy.md
Build:
- Add Dockerfile.test for containerized testing
- Update .gitignore for test artifacts
- Configure test dependencies in VRCAuthProxy.Tests.csproj
This change enables automated testing on PRs and branches, with visual status indicators and detailed test results in PR comments.