-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathChunkedContentTest.cs
More file actions
41 lines (26 loc) · 967 Bytes
/
ChunkedContentTest.cs
File metadata and controls
41 lines (26 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Net;
using System.Net.Http.Json;
using GenHTTP.Modules.Functional;
namespace GenHTTP.Testing.Acceptance.Engine;
[TestClass]
public sealed class ChunkedContentTest
{
#region Tests
[TestMethod]
[MultiEngineTest]
public async Task TestChunkedUpload(TestEngine engine)
{
var inline = Inline.Create()
.Put((Model model) => model);
await using var runner = await TestHost.RunAsync(inline, engine: engine);
using var client = TestHost.GetClient();
using var response = await client.PutAsJsonAsync(runner.GetUrl(), new Model("Hello World"));
await response.AssertStatusAsync(HttpStatusCode.OK);
var result = await response.GetContentAsync();
AssertX.Contains("Hello World", result);
}
#endregion
#region Supporting data structures
private record Model(string Value);
#endregion
}