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.
41 lines
No EOL
1.2 KiB
C#
41 lines
No EOL
1.2 KiB
C#
using System.Net;
|
|
using FluentAssertions;
|
|
using Xunit;
|
|
|
|
namespace VRCAuthProxy.Tests.Unit
|
|
{
|
|
public class HttpClientCookieContainerTests
|
|
{
|
|
[Fact]
|
|
public void HttpClientCookieContainer_ExposesCookieContainer()
|
|
{
|
|
// Arrange
|
|
var cookieContainer = new CookieContainer();
|
|
var handler = new HttpClientHandler { CookieContainer = cookieContainer };
|
|
|
|
// Act
|
|
var client = new HttpClientCookieContainer(handler);
|
|
|
|
// Assert
|
|
client.CookieContainer.Should().BeSameAs(cookieContainer);
|
|
}
|
|
|
|
[Fact]
|
|
public void CookieContainer_CanStoreAndRetrieveCookies()
|
|
{
|
|
// Arrange
|
|
var cookieContainer = new CookieContainer();
|
|
var uri = new Uri("https://test.com");
|
|
|
|
// Act
|
|
cookieContainer.Add(uri, new Cookie("auth", "test-auth-token"));
|
|
|
|
// Assert
|
|
var cookies = cookieContainer.GetCookies(uri);
|
|
cookies.Count.Should().Be(1);
|
|
var authCookie = cookies["auth"];
|
|
authCookie.Should().NotBeNull();
|
|
authCookie!.Value.Should().Be("test-auth-token");
|
|
}
|
|
}
|
|
} |