Skip to content

Restructure tests to Arrange/Act/Assert, and cover the external_links gap - #12

Merged
ivanvyd merged 4 commits into
mainfrom
refactor/aaa-test-structure
Aug 1, 2026
Merged

Restructure tests to Arrange/Act/Assert, and cover the external_links gap#12
ivanvyd merged 4 commits into
mainfrom
refactor/aaa-test-structure

Conversation

@ivanvyd

@ivanvyd ivanvyd commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Applies the Arrange/Act/Assert convention with explicit // Arrange, // Act, // Assert markers and a blank line between sections.

The markers are structural navigation and are the deliberate exception to the usual no-comments-that-restate-the-code rule: a reader should see what is set up, what is exercised and what is claimed without inferring the boundaries. One Act per test — where a test previously fused Act and Assert into a single expression-bodied line, the call is now named and the assertion follows, which makes a test that asserts on nothing visible at a glance.

Also closes a real gap

An_external_links_result_is_refused_rather_than_returned_empty covers the case flagged as failing silently rather than loudly: under EXTERNAL_LINKS disposition data_array is absent, total_row_count can be absent, and there is no next_chunk_index — so the completeness check would have returned zero rows as a successful, complete result. The client now refuses it, and this pins that behaviour.

Scope

Restructured (6 of 10): ExitCodeTests, GenieMessageStateTests, DiagnosticRedactionTests, RedactionEvasionTests, ConfigAliasTests, ResultCompletenessTests.

Still to do (4): OutputFidelityTests, QuestionPackLoaderTests, GenieLifecycleTests, LiveGenieTests. These are behaviourally correct and passing; they just do not yet carry the markers.

129 tests green.

ivanvyd added 4 commits August 1, 2026 10:00
Explicit // Arrange, // Act, // Assert markers with a blank line between sections.
The markers are structural navigation and are the deliberate exception to the usual
no-comments-that-restate-the-code rule: a reader should see what is set up, what is
exercised and what is claimed without inferring the boundaries.

One Act per test. Where a test previously fused Act and Assert into a single
expression-bodied line, the call is now named and the assertion follows it, which
also makes a test that asserts on nothing visible at a glance.

Done: ExitCodeTests, GenieMessageStateTests, DiagnosticRedactionTests,
RedactionEvasionTests, ConfigAliasTests. 128 tests still green.
…nks guard

Adds the case the API research flagged as the one that fails silently rather than
loudly: under EXTERNAL_LINKS disposition data_array is absent, total_row_count can
be absent, and there is no next_chunk_index — so the completeness check would have
returned zero rows as a successful, complete result. The client refuses it instead,
and this pins that.

Six of ten test files now carry explicit Arrange/Act/Assert markers.
Also adds coverage for the leading-tab/CR formula guard, which the previous
value[0] check missed, and pins the client-side rejection of a feedback comment
alongside a NONE rating.

Eight of ten test files done; GenieLifecycleTests and QuestionPackLoaderTests
remain. 131 tests green.
…derTests

All ten test files now carry explicit Arrange/Act/Assert markers. Where a test
asserts a throw, the Should.Throw call is the Act and the inspection of the
exception is the Assert, so the boundary stays visible rather than collapsing into
one expression.

131 tests green.
@ivanvyd
ivanvyd merged commit 974e0d5 into main Aug 1, 2026
10 checks passed
@ivanvyd
ivanvyd deleted the refactor/aaa-test-structure branch August 1, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant