feat(http): ArenaTwoPickController (6 actions)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
29
SVSim.UnitTests/Controllers/ArenaTwoPickControllerTests.cs
Normal file
29
SVSim.UnitTests/Controllers/ArenaTwoPickControllerTests.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
using SVSim.UnitTests.Infrastructure;
|
||||
|
||||
namespace SVSim.UnitTests.Controllers;
|
||||
|
||||
public class ArenaTwoPickControllerTests
|
||||
{
|
||||
[Test]
|
||||
public async Task Top_unauthenticated_returns_401()
|
||||
{
|
||||
using var factory = new SVSimTestFactory();
|
||||
using var client = factory.CreateClient();
|
||||
var resp = await client.PostAsync("/arena_two_pick/top", JsonContent.Create(new { mode = 0 }));
|
||||
Assert.That(resp.StatusCode, Is.EqualTo(HttpStatusCode.Unauthorized));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Top_authed_with_no_run_returns_entry_info_null()
|
||||
{
|
||||
using var factory = new SVSimTestFactory();
|
||||
var viewerId = await factory.SeedViewerAsync();
|
||||
using var client = factory.CreateAuthenticatedClient(viewerId);
|
||||
var resp = await client.PostAsync("/arena_two_pick/top", JsonContent.Create(new { mode = 0 }));
|
||||
Assert.That(resp.StatusCode, Is.EqualTo(HttpStatusCode.OK));
|
||||
var body = await resp.Content.ReadAsStringAsync();
|
||||
StringAssert.Contains("\"entry_info\":null", body);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user