pub struct DeciderTestSpecification<'a, Command, State, Event, Error>{ /* private fields */ }
Expand description
A test specification DSL for deciders that supports the given-when-then
format.
The DSL is used to specify the events that have already occurred (GIVEN), the command that is being executed (WHEN), and the expected events (THEN) that should be generated.
Implementations§
Source§impl<'a, Command, State, Event, Error> DeciderTestSpecification<'a, Command, State, Event, Error>
impl<'a, Command, State, Event, Error> DeciderTestSpecification<'a, Command, State, Event, Error>
Sourcepub fn for_decider(
self,
decider: Decider<'a, Command, State, Event, Error>,
) -> Self
pub fn for_decider( self, decider: Decider<'a, Command, State, Event, Error>, ) -> Self
Specify the decider you want to test
Sourcepub fn given_state(self, state: Option<State>) -> Self
pub fn given_state(self, state: Option<State>) -> Self
Given preconditions / previous state
Sourcepub fn then_state(self, expected_state: State)
pub fn then_state(self, expected_state: State)
Then expect result / new events
Sourcepub fn then_error(self, expected_error: Error)
pub fn then_error(self, expected_error: Error)
Then expect error result / these are not events
Trait Implementations§
Auto Trait Implementations§
impl<'a, Command, State, Event, Error> Freeze for DeciderTestSpecification<'a, Command, State, Event, Error>
impl<'a, Command, State, Event, Error> !RefUnwindSafe for DeciderTestSpecification<'a, Command, State, Event, Error>
impl<'a, Command, State, Event, Error> Send for DeciderTestSpecification<'a, Command, State, Event, Error>
impl<'a, Command, State, Event, Error> Sync for DeciderTestSpecification<'a, Command, State, Event, Error>
impl<'a, Command, State, Event, Error> Unpin for DeciderTestSpecification<'a, Command, State, Event, Error>
impl<'a, Command, State, Event, Error> !UnwindSafe for DeciderTestSpecification<'a, Command, State, Event, Error>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more