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§
Sourcefn assert_first(&self, expected: A)
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.
Sourcefn assert_last(&self, expected: A)
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.
Sourcefn assert_contains(&self, expected: A)
fn assert_contains(&self, expected: A)
Assert that the vector contains the expected action.
§Panics
Panics if no action matches the expected value.
Sourcefn assert_not_contains(&self, expected: A)
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.