givenEvent
Sets up the aggregate with a single initial event.
This method initializes the aggregate state by replaying the specified domain event, simulating that the event has already occurred in the aggregate's history. This is useful for testing scenarios that depend on previous aggregate state changes.
Parameters
the initial domain event to replay on the aggregate
the test scenario continuation using WhenDsl for command execution
Sets up the aggregate by replaying multiple domain events.
This method initializes the aggregate state by replaying a sequence of domain events in order, reconstructing the aggregate's state as if these events had occurred previously. This enables testing of complex scenarios that require specific historical context.
Parameters
array of domain events to replay in sequence (empty array for no initial events)
the test scenario continuation using WhenDsl for command execution