-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathMethodTests.cs
More file actions
25 lines (18 loc) · 669 Bytes
/
MethodTests.cs
File metadata and controls
25 lines (18 loc) · 669 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
using System.Net;
using GenHTTP.Api.Protocol;
using GenHTTP.Modules.Functional;
namespace GenHTTP.Testing.Acceptance.Engine;
[TestClass]
public sealed class MethodTests
{
[TestMethod]
[MultiEngineTest]
public async Task TestCustomMethods(TestEngine engine)
{
var result = Inline.Create().On(() => "Hmm, Beer", [FlexibleRequestMethod.Get("BREW")]);
await using var host = await TestHost.RunAsync(result, engine: engine);
var request = host.GetRequest(method: new HttpMethod("BREW"));
using var response = await host.GetResponseAsync(request);
await response.AssertStatusAsync(HttpStatusCode.OK);
}
}