CheckThatResultAssertion

Trait CheckThatResultAssertion 

Source
pub trait CheckThatResultAssertion<'a, R> {
    // Required methods
    fn facts_are<B: Borrow<Vec<Fact>>>(&self, facts: B) -> R;
    fn facts_are_at_least<B: Borrow<Vec<Fact>>>(&self, facts: B) -> R;
    fn fact_value_for_key<I: Into<String>>(
        &self,
        key: I,
    ) -> Subject<'_, String, (), R>;
    fn fact_keys(&self) -> Subject<'a, HashSet<&String>, (), R>;
}
Expand description

Trait for assertions for assertion messages.

§Example

use assertor::*;
use assertor::testing::*;

assert_that!(check_that!("actual_string").is_same_string_to("expected_string")).facts_are(vec![
    Fact::new("expected", "expected_string"),
    Fact::new("actual", "actual_string"),
]);

Required Methods§

Source

fn facts_are<B: Borrow<Vec<Fact>>>(&self, facts: B) -> R

Checks that the assertion result contains elements of facts in order.

Source

fn facts_are_at_least<B: Borrow<Vec<Fact>>>(&self, facts: B) -> R

Checks that the assertion result contains elements of facts in order.

Source

fn fact_value_for_key<I: Into<String>>( &self, key: I, ) -> Subject<'_, String, (), R>

Returns the first fact value whose key is equal to key.

Source

fn fact_keys(&self) -> Subject<'a, HashSet<&String>, (), R>

Returns keys of the assertion messages.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§