NEO-94: Address code review — alignment doc and AAA test layout.
Append NEO-94 landed to E5.M2 tracking row; move ReadFromJsonAsync to Assert in snapshot integration tests.pull/132/head
parent
e3bfcf0708
commit
798c601bc5
File diff suppressed because one or more lines are too long
|
|
@ -19,7 +19,7 @@ The rewritten branch delivers E5M2-08 cleanly: **`GET /game/world/npc-runtime-sn
|
|||
| `docs/plans/NEO-94-implementation-plan.md` | **Matches** — AC checkboxes marked done; handler flow, wire shape, lazy tick, and file list align with the diff. |
|
||||
| `docs/plans/E5M2-prototype-backlog.md` (E5M2-08) | **Matches** — AC checked, landed note present. |
|
||||
| `docs/decomposition/modules/E5_M2_NpcAiAndBehaviorProfiles.md` | **Matches** — E5M2-08 landed in status table; NEO-94 HTTP section + README/Bruno cross-links. |
|
||||
| `docs/decomposition/modules/documentation_and_implementation_alignment.md` | **Partially matches** — E5.M2 row still ends at **NEO-93**; should add **NEO-94 landed** note per plan. |
|
||||
| `docs/decomposition/modules/documentation_and_implementation_alignment.md` | **Matches** — E5.M2 row includes **NEO-94 landed** (snapshot GET, Bruno folder, plan/README links). |
|
||||
| `docs/decomposition/modules/client_server_authority.md` | **Matches** — server-owned runtime + telegraph timing; client poll-only (NEO-97 deferred). |
|
||||
| `server/README.md` | **Matches** — threat/runtime HTTP read rows updated; dedicated NEO-94 section with field table and curl. |
|
||||
|
||||
|
|
@ -29,9 +29,9 @@ None.
|
|||
|
||||
## Suggestions
|
||||
|
||||
1. **Update `documentation_and_implementation_alignment.md`** — Append **NEO-94 landed** to the E5.M2 tracking row (snapshot GET, Bruno folder, plan/README links), matching NEO-90–NEO-93 entries. Listed in the plan “Files to modify” but not yet in the diff.
|
||||
1. ~~**Update `documentation_and_implementation_alignment.md`** — Append **NEO-94 landed** to the E5.M2 tracking row (snapshot GET, Bruno folder, plan/README links), matching NEO-90–NEO-93 entries. Listed in the plan “Files to modify” but not yet in the diff.~~ **Done.**
|
||||
|
||||
2. **AAA layout in two integration tests** — `GetNpcRuntimeSnapshot_ShouldShowAggro_OnMeleeAfterDamagingCast` and `GetNpcRuntimeSnapshot_ShouldShowTelegraph_AfterAttackCooldownElapses` call **`ReadFromJsonAsync`** in **Act**. Move status/body reads to **Assert** to match **`CombatTargetsWorldApiTests`** and [csharp-style](../../.cursor/rules/csharp-style.md#unit-and-integration-tests-arrange-act-assert):
|
||||
2. ~~**AAA layout in two integration tests** — `GetNpcRuntimeSnapshot_ShouldShowAggro_OnMeleeAfterDamagingCast` and `GetNpcRuntimeSnapshot_ShouldShowTelegraph_AfterAttackCooldownElapses` call **`ReadFromJsonAsync`** in **Act**. Move status/body reads to **Assert** to match **`CombatTargetsWorldApiTests`** and [csharp-style](../../.cursor/rules/csharp-style.md#unit-and-integration-tests-arrange-act-assert):
|
||||
|
||||
```csharp
|
||||
// Act
|
||||
|
|
@ -39,7 +39,7 @@ None.
|
|||
// Assert
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
var body = await response.Content.ReadFromJsonAsync<NpcRuntimeSnapshotResponse>();
|
||||
```
|
||||
```~~ **Done.** Aggro + telegraph tests fixed; decreasing-windup test also moves all **`ReadFromJsonAsync`** calls to **Assert**.
|
||||
|
||||
## Nits
|
||||
|
||||
|
|
|
|||
|
|
@ -88,9 +88,9 @@ public sealed class NpcRuntimeSnapshotWorldApiTests
|
|||
castResponse.EnsureSuccessStatusCode();
|
||||
// Act
|
||||
var response = await client.GetAsync("/game/world/npc-runtime-snapshot");
|
||||
var body = await response.Content.ReadFromJsonAsync<NpcRuntimeSnapshotResponse>();
|
||||
// Assert
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
var body = await response.Content.ReadFromJsonAsync<NpcRuntimeSnapshotResponse>();
|
||||
Assert.NotNull(body);
|
||||
var melee = body!.NpcInstances.Single(row => row.NpcInstanceId == PrototypeNpcRegistry.PrototypeNpcMeleeId);
|
||||
Assert.Equal("aggro", melee.State);
|
||||
|
|
@ -126,9 +126,9 @@ public sealed class NpcRuntimeSnapshotWorldApiTests
|
|||
factory.FakeClock!.Advance(TimeSpan.FromSeconds(3));
|
||||
// Act
|
||||
var response = await client.GetAsync("/game/world/npc-runtime-snapshot");
|
||||
var body = await response.Content.ReadFromJsonAsync<NpcRuntimeSnapshotResponse>();
|
||||
// Assert
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
var body = await response.Content.ReadFromJsonAsync<NpcRuntimeSnapshotResponse>();
|
||||
Assert.NotNull(body);
|
||||
var melee = body!.NpcInstances.Single(row => row.NpcInstanceId == PrototypeNpcRegistry.PrototypeNpcMeleeId);
|
||||
Assert.Equal("telegraph_windup", melee.State);
|
||||
|
|
@ -155,12 +155,14 @@ public sealed class NpcRuntimeSnapshotWorldApiTests
|
|||
initResponse.EnsureSuccessStatusCode();
|
||||
factory.FakeClock!.Advance(TimeSpan.FromSeconds(3));
|
||||
var firstResponse = await client.GetAsync("/game/world/npc-runtime-snapshot");
|
||||
var firstBody = await firstResponse.Content.ReadFromJsonAsync<NpcRuntimeSnapshotResponse>();
|
||||
factory.FakeClock.Advance(TimeSpan.FromSeconds(1));
|
||||
// Act
|
||||
var secondResponse = await client.GetAsync("/game/world/npc-runtime-snapshot");
|
||||
var secondBody = await secondResponse.Content.ReadFromJsonAsync<NpcRuntimeSnapshotResponse>();
|
||||
// Assert
|
||||
Assert.Equal(HttpStatusCode.OK, firstResponse.StatusCode);
|
||||
Assert.Equal(HttpStatusCode.OK, secondResponse.StatusCode);
|
||||
var firstBody = await firstResponse.Content.ReadFromJsonAsync<NpcRuntimeSnapshotResponse>();
|
||||
var secondBody = await secondResponse.Content.ReadFromJsonAsync<NpcRuntimeSnapshotResponse>();
|
||||
Assert.NotNull(firstBody);
|
||||
Assert.NotNull(secondBody);
|
||||
var firstMelee = firstBody!.NpcInstances.Single(row => row.NpcInstanceId == PrototypeNpcRegistry.PrototypeNpcMeleeId);
|
||||
|
|
|
|||
Loading…
Reference in New Issue