Files
SVSimServer/SVSim.UnitTests/Controllers/ArenaTwoPickBattleControllerTests.cs
2026-05-31 11:27:02 -04:00

25 lines
1.0 KiB
C#

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);
}
}