Struct galvanic_mock_lib::MockState
[−]
[src]
pub struct MockState { pub given_behaviours: RefCell<HashMap<(&'static str, &'static str), Vec<GivenBehaviour>>>, pub expect_behaviours: RefCell<HashMap<(&'static str, &'static str), Vec<ExpectBehaviour>>>, // some fields omitted }
Stores the state of a mock.
The state of a mock object is compromised by its enabled given and expected behaviours. As well as its verification policies.
Fields
given_behaviours: RefCell<HashMap<(&'static str, &'static str), Vec<GivenBehaviour>>>
The enabled given behaviours addressed by a tuple of the names of the mocked trait and method.
expect_behaviours: RefCell<HashMap<(&'static str, &'static str), Vec<ExpectBehaviour>>>
The enabled expected behaviours addressed by a tuple of the names of the mocked trait and method.
Methods
impl MockState
[src]
Trait Implementations
impl MockControl for MockState
[src]
fn should_verify_on_drop(&mut self, flag: bool)
[src]
Passing true
enables verification of expected behaviours when the mock object is dropped. Read more
fn add_given_behaviour(
&self,
requested_trait: &'static str,
method: &'static str,
behaviour: GivenBehaviour
)
[src]
&self,
requested_trait: &'static str,
method: &'static str,
behaviour: GivenBehaviour
)
For internal use only. Read more
fn reset_given_behaviours(&mut self)
[src]
Deactivates all behaviours activated by a given!
-block before.
fn add_expect_behaviour(
&self,
requested_trait: &'static str,
method: &'static str,
behaviour: ExpectBehaviour
)
[src]
&self,
requested_trait: &'static str,
method: &'static str,
behaviour: ExpectBehaviour
)
For internal use only. Read more
fn reset_expected_behaviours(&mut self)
[src]
Deactivates all behaviours activated by a expect_interactions!
-block before.
fn are_expected_behaviours_satisfied(&self) -> bool
[src]
Returns true
iff all expected interactions with the mock have occurred.
fn verify(&self)
[src]
Panics if some expected interaction with the mock has not occurred. Read more