Skip to content

Commit

Permalink
Add new proxy test for random port
Browse files Browse the repository at this point in the history
This commit adds a new test method `Test_Random_Port` to the `ProxyTests` class. This test ensures that the proxy is able to run and handle traffic on random ports within a valid range.
  • Loading branch information
haga-rak committed Jan 25, 2024
1 parent a9c7817 commit cf1e110
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/Fluxzy.Tests/ProxyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,20 @@ public async Task Exchange_State_Must_Be_Complete_When_Chunked()
}
}

[Fact]
public async Task Test_Random_Port()
{
var startupSetting = FluxzySetting
.CreateLocalRandomPort();

await using var proxy = new Proxy(startupSetting);
var endPoints = proxy.Run();

Assert.Single(endPoints);
Assert.True(endPoints.First().Port >= 1000);
Assert.True(endPoints.First().Port < 65535);
}

[Fact]
public async Task Test_GetThrough_H1_Plain()
{
Expand Down Expand Up @@ -525,5 +539,6 @@ await response.Content.ReadAsStringAsync(
await proxy.DisposeAsync();
}
}

}
}

0 comments on commit cf1e110

Please sign in to comment.