Skip to content

Commit 72581f2

Browse files
committed
Update testing docs for MockCommand v9.3.0 API
Update documentation to use new "run" terminology: - queueResultsForNextExecuteCall → queueResultsForNextRunCall - startExecution() → startRun() - endExecutionWithData() → endRunWithData() - endExecutionWithError() → endRunWithError() - endExecutionNoData() → endRunNoData() - executionCount → runCount Updated files: - docs/documentation/command_it/testing.md - code_samples/test/command_it/mock_command_example_test.dart All tests passing.
1 parent d7c4c80 commit 72581f2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

code_samples/test/command_it/mock_command_example_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ class MockDataService implements DataService {
3737
// Control methods make tests readable and maintainable
3838
void queueSuccess(String query, List<Item> data) {
3939
(loadCommand as MockCommand<String, List<Item>>)
40-
.queueResultsForNextExecuteCall([
40+
.queueResultsForNextRunCall([
4141
CommandResult<String, List<Item>>(query, data, null, false),
4242
]);
4343
}
4444

4545
void simulateError(String message) {
46-
(loadCommand as MockCommand).endExecutionWithError(message);
46+
(loadCommand as MockCommand).endRunWithError(message);
4747
}
4848
}
4949

docs/documentation/command_it/testing.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ For testing code that depends on commands, use the built-in `MockCommand` class
145145

146146
**Key MockCommand methods:**
147147

148-
- **<code>queueResultsForNextExecuteCall(List&lt;CommandResult&lt;TParam, TResult&gt;&gt;)</code>** - Queue multiple results to be returned in sequence
149-
- **`startExecution()`** - Manually trigger the running state
150-
- **`endExecutionWithData(TResult data)`** - Complete execution with a result
151-
- **`endExecutionNoData()`** - Complete execution without a result (void commands)
152-
- **`endExecutionWithError(String message)`** - Complete execution with an error
153-
- **`executionCount`** - Track how many times the command was executed
148+
- **<code>queueResultsForNextRunCall(List&lt;CommandResult&lt;TParam, TResult&gt;&gt;)</code>** - Queue multiple results to be returned in sequence
149+
- **`startRun()`** - Manually trigger the running state
150+
- **`endRunWithData(TResult data)`** - Complete execution with a result
151+
- **`endRunNoData()`** - Complete execution without a result (void commands)
152+
- **`endRunWithError(String message)`** - Complete execution with an error
153+
- **`runCount`** - Track how many times the command was run
154154

155155
**This pattern demonstrates:**
156156

0 commit comments

Comments
 (0)