orchestrator_test 0.1.0
orchestrator_test: ^0.1.0 copied to clipboard
Testing utilities for Orchestrator framework. Provides mocks, helpers, and custom matchers for easy unit testing of Orchestrator-based code.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.0 - 2024-12-27 #
Added #
- Initial release of
orchestrator_testpackage - Mocks
MockDispatcher- Mocktail mock for DispatcherMockSignalBus- Mocktail mock for SignalBusMockExecutor<T>- Mocktail mock for BaseExecutor
- Fakes
FakeDispatcher- Captures dispatched jobs and simulates eventsFakeSignalBus- Captures emitted events with stream supportFakeCacheProvider- In-memory cache with optional TTL trackingFakeConnectivityProvider- Simulate online/offline statesFakeNetworkQueueStorage- In-memory queue storageFakeExecutor<T>- Captures processed jobs with custom results
- Test Helpers
testOrchestrator- BDD-style orchestrator state testingtestOrchestratorEvents- Test orchestrator event handlingEventCapture- Capture and wait for events
- Event Matchers
isJobSuccess()- Match JobSuccessEventisJobFailure()- Match JobFailureEventisJobProgress()- Match JobProgressEventisJobCancelled()- Match JobCancelledEventisJobTimeout()- Match JobTimeoutEventemitsEventsInOrder()- Match event sequenceemitsEventsContaining()- Match events in any order
- Job Matchers
isJobOfType<T>()- Match job typehasJobId()- Match job IDhasTimeout()- Match job timeouthasCancellationToken()- Match job with tokenhasRetryPolicy()- Match job retry policycontainsJobOfType<T>()- List contains job typehasJobCount<T>()- List has N jobs of type