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

The enabled given behaviours addressed by a tuple of the names of the mocked trait and method.

The enabled expected behaviours addressed by a tuple of the names of the mocked trait and method.

Methods

impl MockState
[src]

[src]

Trait Implementations

impl MockControl for MockState
[src]

[src]

Passing true enables verification of expected behaviours when the mock object is dropped. Read more

[src]

For internal use only. Read more

[src]

Deactivates all behaviours activated by a given!-block before.

[src]

For internal use only. Read more

[src]

Deactivates all behaviours activated by a expect_interactions!-block before.

[src]

Returns true iff all expected interactions with the mock have occurred.

[src]

Panics if some expected interaction with the mock has not occurred. Read more

impl Drop for MockState
[src]

[src]

Verfies the expected interactions on the mock if the policy is enabled.

Panics

iff the verification fails.