Skip to main content

ActionAssertionsEq

Trait ActionAssertionsEq 

Source
pub trait ActionAssertionsEq<A> {
    // Required methods
    fn assert_first(&self, expected: A);
    fn assert_last(&self, expected: A);
    fn assert_contains(&self, expected: A);
    fn assert_not_contains(&self, expected: A);
}
Expand description

Equality-based assertions for action vectors.

This trait requires PartialEq for equality comparisons. For predicate-based assertions that don’t need PartialEq, use ActionAssertions.

§Example

use tui_dispatch::testing::ActionAssertionsEq;

let actions = harness.drain_emitted();
actions.assert_first(Action::StartSearch);
actions.assert_contains(Action::SelectKey(42));

Required Methods§

Source

fn assert_first(&self, expected: A)

Assert that the first action equals the expected value.

§Panics

Panics if the vector is empty or the first action doesn’t match.

Source

fn assert_last(&self, expected: A)

Assert that the last action equals the expected value.

§Panics

Panics if the vector is empty or the last action doesn’t match.

Source

fn assert_contains(&self, expected: A)

Assert that the vector contains the expected action.

§Panics

Panics if no action matches the expected value.

Source

fn assert_not_contains(&self, expected: A)

Assert that the vector does not contain the expected action.

§Panics

Panics if any action matches the expected value.

Implementations on Foreign Types§

Source§

impl<A> ActionAssertionsEq<A> for [A]
where A: PartialEq + Debug,

Source§

fn assert_first(&self, expected: A)

Source§

fn assert_last(&self, expected: A)

Source§

fn assert_contains(&self, expected: A)

Source§

fn assert_not_contains(&self, expected: A)

Source§

impl<A> ActionAssertionsEq<A> for Vec<A>
where A: PartialEq + Debug,

Source§

fn assert_first(&self, expected: A)

Source§

fn assert_last(&self, expected: A)

Source§

fn assert_contains(&self, expected: A)

Source§

fn assert_not_contains(&self, expected: A)

Implementors§