Stacks a second [HttpPost("/tutorial/pack_info")] absolute route on
PackController.Info so the tutorial flow resolves to the same action
and returns the same pack_config_list as /pack/info (no filtering in v1).
Adds PackControllerTests.cs with TutorialPackInfo_returns_same_list_as_pack_info
verifying byte-identical responses from both URLs.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
1.2 KiB
C#
30 lines
1.2 KiB
C#
using System.Net;
|
|
using System.Text;
|
|
using SVSim.UnitTests.Infrastructure;
|
|
|
|
namespace SVSim.UnitTests.Controllers;
|
|
|
|
public class PackControllerTests
|
|
{
|
|
[Test]
|
|
public async Task TutorialPackInfo_returns_same_list_as_pack_info()
|
|
{
|
|
using var factory = new SVSimTestFactory();
|
|
await factory.SeedGlobalsAsync();
|
|
long viewerId = await factory.SeedViewerAsync(tutorialState: 41);
|
|
using var client = factory.CreateAuthenticatedClient(viewerId);
|
|
|
|
var json = """{"viewer_id":"0","steam_id":0,"steam_session_ticket":""}""";
|
|
var direct = await client.PostAsync("/pack/info", new StringContent(json, Encoding.UTF8, "application/json"));
|
|
var tutorial = await client.PostAsync("/tutorial/pack_info", new StringContent(json, Encoding.UTF8, "application/json"));
|
|
|
|
Assert.That(direct.StatusCode, Is.EqualTo(HttpStatusCode.OK));
|
|
Assert.That(tutorial.StatusCode, Is.EqualTo(HttpStatusCode.OK));
|
|
|
|
var directBody = await direct.Content.ReadAsStringAsync();
|
|
var tutorialBody = await tutorial.Content.ReadAsStringAsync();
|
|
Assert.That(tutorialBody, Is.EqualTo(directBody),
|
|
"tutorial/pack_info wire shape must match /pack/info exactly (no filtering in v1).");
|
|
}
|
|
}
|