Add comprehensive backend test suite and helper access
This commit is contained in:
@@ -32,4 +32,15 @@ public class ResultsTests
|
||||
Assert.Equal("ResultGame", first.GetProperty("name").GetString());
|
||||
Assert.Equal(8, (int)first.GetProperty("average").GetDouble());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Results_locked_returns_error()
|
||||
{
|
||||
using var factory = new TestWebApplicationFactory();
|
||||
var client = factory.CreateClientWithCookies();
|
||||
await client.RegisterAsync("user");
|
||||
await client.PostAsJsonAsync("/api/me/phase/next", new { });
|
||||
var resp = await client.GetAsync("/api/results");
|
||||
Assert.Equal(System.Net.HttpStatusCode.BadRequest, resp.StatusCode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user