test: cover empty pairing request body
This commit is contained in:
parent
061c3baab3
commit
271ff76909
@ -52,6 +52,23 @@ public sealed class PairingEndpointsTests
|
||||
Assert.Equal("rejected", payload.Status);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Redeem_Returns_BadRequest_When_Request_Body_Is_Empty()
|
||||
{
|
||||
await using var fixture = new PairingApiFixture();
|
||||
using var client = fixture.CreateClient();
|
||||
using var content = new StringContent(string.Empty, Encoding.UTF8, "application/json");
|
||||
|
||||
using var response = await client.PostAsync("/api/pairing/redeem", content);
|
||||
var payload = await response.Content.ReadFromJsonAsync<RedeemResponse>();
|
||||
|
||||
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
Assert.NotNull(payload);
|
||||
Assert.False(payload.Success);
|
||||
Assert.Equal("invalid_request", payload.ErrorCode);
|
||||
Assert.Equal("rejected", payload.Status);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task CreateCode_Does_Not_Write_Secret_Code_To_Audit_Log()
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user