Skip to content

Commit 53ca611

Browse files
committed
test: update test suite
1 parent 9d643ef commit 53ca611

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

tests/Builders/HttpClientBuilderTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public void WithUserAgent_Null_Throws()
5252
public void Chaining_Works()
5353
{
5454
var options = new HttpClientBuilder()
55-
.WithLibraryPath(TestConstants.LibraryPath)
5655
.WithBrowserType(BrowserType.Firefox132)
5756
.WithTimeout(TimeSpan.FromSeconds(30))
5857
.WithProxy("http://proxy:8080", true)

tests/Http2ClientOptionsTests.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ namespace Http2Client.Test;
88

99
public class Http2ClientOptionsTests
1010
{
11+
static Http2ClientOptionsTests()
12+
{
13+
Http2Client.Initialize(TestConstants.LibraryPath);
14+
}
15+
1116
[Fact]
1217
public void SetsDefaults()
1318
{
@@ -51,7 +56,6 @@ public void Validate_Cookies_Throws()
5156
{
5257
var options = new Http2ClientOptions
5358
{
54-
LibraryPath = TestConstants.LibraryPath,
5559
WithDefaultCookieJar = true,
5660
WithoutCookieJar = true
5761
};
@@ -67,7 +71,6 @@ public void Validate_IP_Throws()
6771
{
6872
var options = new Http2ClientOptions
6973
{
70-
LibraryPath = TestConstants.LibraryPath,
7174
DisableIPv4 = true,
7275
DisableIPv6 = true
7376
};
@@ -83,7 +86,6 @@ public void Validate_Timeout_Throws()
8386
{
8487
var options = new Http2ClientOptions
8588
{
86-
LibraryPath = TestConstants.LibraryPath,
8789
Timeout = TimeSpan.Zero
8890
};
8991

@@ -95,20 +97,12 @@ public void Validate_ProxyUrl_Throws()
9597
{
9698
var options = new Http2ClientOptions
9799
{
98-
LibraryPath = TestConstants.LibraryPath,
99100
ProxyUrl = "invalid-url"
100101
};
101102

102103
options.Invoking(o => o.Validate()).Should().Throw<ArgumentException>();
103104
}
104105

105-
[Fact]
106-
public void Validate_LibraryPath_Throws()
107-
{
108-
var options = new Http2ClientOptions { LibraryPath = "nonexistent.dll" };
109-
options.Invoking(o => o.Validate()).Should().Throw<FileNotFoundException>();
110-
}
111-
112106
[Fact]
113107
public void Clone_Works()
114108
{

tests/Http2ClientTests.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ namespace Http2Client.Test;
66

77
public class Http2ClientTests
88
{
9+
static Http2ClientTests()
10+
{
11+
Http2Client.Initialize(TestConstants.LibraryPath);
12+
}
13+
914
[Fact]
1015
public void Ctor_Null_Throws()
1116
{
@@ -16,7 +21,7 @@ public void Ctor_Null_Throws()
1621
[Fact]
1722
public void Ctor_ValidOptions_Works()
1823
{
19-
var options = new Http2ClientOptions { LibraryPath = TestConstants.LibraryPath };
24+
var options = new Http2ClientOptions();
2025

2126
using var client = new Http2Client(options);
2227

@@ -28,8 +33,7 @@ public void Ctor_ValidOptions_Works()
2833
[Fact]
2934
public void Dispose_Works()
3035
{
31-
var options = new Http2ClientOptions { LibraryPath = TestConstants.LibraryPath };
32-
var client = new Http2Client(options);
36+
var client = new Http2Client();
3337

3438
client.Dispose();
3539

@@ -39,8 +43,7 @@ public void Dispose_Works()
3943
[Fact]
4044
public void Send_NullRequest_Throws()
4145
{
42-
var options = new Http2ClientOptions { LibraryPath = TestConstants.LibraryPath };
43-
using var client = new Http2Client(options);
46+
using var client = new Http2Client();
4447

4548
var action = () => client.Send(null!);
4649
action.Should().Throw<ArgumentNullException>();

tests/Http2ClientWebTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ public class Http2ClientWebTests
1414
{
1515
private Http2Client? _client;
1616

17+
static Http2ClientWebTests()
18+
{
19+
Http2Client.Initialize(TestConstants.LibraryPath);
20+
}
21+
1722
[Fact]
1823
public void TlsPeet_Works()
1924
{
@@ -131,7 +136,6 @@ public void Headers_Work()
131136
private Http2Client CreateClient()
132137
{
133138
return new HttpClientBuilder()
134-
.WithLibraryPath(TestConstants.LibraryPath)
135139
.WithBrowserType(BrowserType.Chrome133)
136140
.WithUserAgent("Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36")
137141
.WithCookies()

0 commit comments

Comments
 (0)