Restructure tests to Arrange/Act/Assert, and cover the external_links gap - #12
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Applies the Arrange/Act/Assert convention with explicit
// Arrange,// Act,// Assertmarkers 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_emptycovers the case flagged as failing silently rather than loudly: underEXTERNAL_LINKSdispositiondata_arrayis absent,total_row_countcan be absent, and there is nonext_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.