Getting ready to seed more data
This commit is contained in:
@@ -10,9 +10,9 @@ using SVSim.UnitTests.Infrastructure;
|
||||
namespace SVSim.UnitTests.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Coverage for <c>/deck/*</c> — the deck-editor CRUD surface. Plain-JSON path; the
|
||||
/// camelCase'd C# property names are what tests see (see the note on Phase 6 / encrypted
|
||||
/// pipeline for the msgpack contract).
|
||||
/// Coverage for <c>/deck/*</c> — the deck-editor CRUD surface. Tests assert against the
|
||||
/// <c>[Key("...")]</c>-driven wire keys (mirrored to <c>[JsonPropertyName]</c>); these are
|
||||
/// the names the decompiled client actually parses, NOT <c>SnakeCaseLower(C# property)</c>.
|
||||
/// </summary>
|
||||
public class DeckControllerTests
|
||||
{
|
||||
@@ -53,7 +53,7 @@ public class DeckControllerTests
|
||||
Assert.That(decks.GetArrayLength(), Is.EqualTo(2),
|
||||
"Only Rotation-format decks should be returned for a Rotation request.");
|
||||
var names = Enumerable.Range(0, decks.GetArrayLength())
|
||||
.Select(i => decks[i].GetProperty("name").GetString())
|
||||
.Select(i => decks[i].GetProperty("deck_name").GetString())
|
||||
.ToList();
|
||||
Assert.That(names, Is.EquivalentTo(new[] { "Slot 1", "Slot 2" }));
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class DeckControllerTests
|
||||
using var doc = JsonDocument.Parse(body);
|
||||
var decks = doc.RootElement.GetProperty("user_deck_list");
|
||||
Assert.That(decks.GetArrayLength(), Is.EqualTo(1));
|
||||
Assert.That(decks[0].GetProperty("name").GetString(), Is.EqualTo("Unlimited Deck"));
|
||||
Assert.That(decks[0].GetProperty("deck_name").GetString(), Is.EqualTo("Unlimited Deck"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -232,7 +232,7 @@ public class DeckControllerTests
|
||||
Assert.That(decks.GetArrayLength(), Is.EqualTo(2),
|
||||
"/deck/update should hand back the full refreshed list, saving the client a follow-up.");
|
||||
var names = Enumerable.Range(0, decks.GetArrayLength())
|
||||
.Select(i => decks[i].GetProperty("name").GetString())
|
||||
.Select(i => decks[i].GetProperty("deck_name").GetString())
|
||||
.ToList();
|
||||
Assert.That(names, Is.EquivalentTo(new[] { "Existing", "Second" }));
|
||||
}
|
||||
@@ -252,7 +252,7 @@ public class DeckControllerTests
|
||||
|
||||
var body = await response.Content.ReadAsStringAsync();
|
||||
using var doc = JsonDocument.Parse(body);
|
||||
Assert.That(doc.RootElement.GetProperty("user_deck").GetProperty("name").GetString(),
|
||||
Assert.That(doc.RootElement.GetProperty("user_deck").GetProperty("deck_name").GetString(),
|
||||
Is.EqualTo("New Name"));
|
||||
|
||||
using var scope = factory.Services.CreateScope();
|
||||
|
||||
Reference in New Issue
Block a user