-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeleteFooTests.cs
More file actions
24 lines (21 loc) · 864 Bytes
/
Copy pathDeleteFooTests.cs
File metadata and controls
24 lines (21 loc) · 864 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
using System.Net;
using AwesomeAssertions;
namespace Example.OpenApi32.IntegrationTests;
public class DeleteFooTests(FooApplicationFactory app) : FooTestSpecification, IClassFixture<FooApplicationFactory>
{
[Fact]
public async Task When_Deleting_Foo_It_Should_Return_Ok()
{
using var client = app.CreateClient();
var result = await client.SendAsync(new HttpRequestMessage()
{
RequestUri = new Uri(client.BaseAddress!, "/foo/1"),
Method = new HttpMethod("DELETE")
}, CancellationToken);
result.StatusCode.Should().Be(HttpStatusCode.OK);
var responseContent = await result.Content.ReadAsByteArrayAsync(CancellationToken);
responseContent.Should().BeEmpty();
result.Content.Headers.ContentType.Should().BeNull();
result.Headers.Should().BeEmpty();
}
}