feat(http): ArenaTwoPickBattleController (do_matching stub + finish)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-05-31 11:27:02 -04:00
parent f272690a31
commit 09b8c49743
6 changed files with 207 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using System.Net;
using System.Net.Http.Json;
using SVSim.UnitTests.Infrastructure;
namespace SVSim.UnitTests.Controllers;
public class ArenaTwoPickBattleControllerTests
{
[Test]
public async Task DoMatching_returns_perpetual_searching_with_empty_node_url()
{
using var factory = new SVSimTestFactory();
var viewerId = await factory.SeedViewerAsync();
using var client = factory.CreateAuthenticatedClient(viewerId);
var req = new { deck_no = 1L, need_init = 1, log = 1, excluded_field_id_list = new long[] { }, use_stage_select = 1, is_default_skin = 0 };
var resp = await client.PostAsync("/arena_two_pick_battle/do_matching", JsonContent.Create(req));
Assert.That(resp.StatusCode, Is.EqualTo(HttpStatusCode.OK));
var body = await resp.Content.ReadAsStringAsync();
StringAssert.Contains("\"matching_state\":3002", body);
StringAssert.Contains("\"node_server_url\":\"\"", body);
StringAssert.DoesNotContain("\"battle_id\"", body);
}
}