Add test: CanRequestChunkEncodedAsync
MODIFY
MagicalCryptoWallet.Tests/TorTests.cs
MagicalCryptoWallet.Tests/TorTests.cs
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
+using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Xunit;
@@ -41,6 +42,17 @@ namespace MagicalCryptoWallet.Tests
}
}
+ [Fact]
+ public async Task CanRequestChunkEncodedAsync()
+ {
+ using (var client = new TorHttpClient(new Uri("https://jigsaw.w3.org/")))
+ {
+ var response = await client.SendAsync(HttpMethod.Get, "/HTTP/ChunkedScript");
+ var content = await response.Content.ReadAsStringAsync();
+ Assert.Equal(1000, Regex.Matches(content, "01234567890123456789012345678901234567890123456789012345678901234567890").Count);
+ }
+ }
+
private static async Task<List<string>> QBitTestAsync(TorHttpClient client, int times, bool alterRequests = false)
{
var relativetUri = "/whatisit/what%20is%20my%20future";

Add test: CanRequestChunkEncodedAsync