Asserter

Struct Asserter 

Source
pub struct Asserter<T> { /* private fields */ }

Implementations§

Source§

impl Asserter<bool>

Source

pub fn is_true(&self)

Checks if the boolean is true.

Source

pub fn is_false(&self)

Checks if the boolean is true.

Source§

impl<'a, K, V> Asserter<&HashMap<K, V>>
where K: Eq + Hash + Display,

Source

pub fn has_length(&self, expected_length: usize)

Checks the length of the HashMap

Source

pub fn is_empty(&self)

Checks if the HashMap is empty

Source

pub fn is_not_empty(&self)

Checks if the HashMap is not empty

Source

pub fn contains_key(&'a self, expected_key: &'a K) -> ValueAssertions<'a, K, V>

Checks if the HashMap contains the specified key

Source

pub fn does_not_contain_key(&self, not_expected_key: K)

Checks if the HashMap does not contain the specified key

Source§

impl<T> Asserter<T>
where T: Copy + PartialOrd + Debug + Display,

Source

pub fn is_smaller_than(self, expected: T)

Source

pub fn is_smaller_than_or_equal_to(self, expected: T)

Source

pub fn is_greater_than(self, expected: T)

Source

pub fn is_greater_than_or_equal_to(self, expected: T)

Source

pub fn is_in_range(self, expected_lower_range: T, expected_upper_range: T)

Source

pub fn is_not_in_range(self, expected_lower_range: T, expected_upper_range: T)

Source§

impl<T> Asserter<Option<T>>
where T: PartialEq + Display,

Source

pub fn is_some(&self)

Source

pub fn is_some_with_value(&self, value: T)

Source

pub fn is_none(&self)

Source§

impl<T, K> Asserter<&Result<T, K>>

Source

pub fn is_ok(&self)

Source

pub fn is_error(&self)

Source

pub fn is_ok_with_value(&self, expected_value: T)

Source

pub fn is_error_with_value(&self, expected_value: K)

Source§

impl<T> Asserter<T>
where T: Debug + PartialEq,

Source

pub fn new(value: T, name: String) -> Asserter<T>

Source

pub fn is_equal_to(&self, expected_value: T)

Source

pub fn is_not_equal_to(&self, expected_value: T)

Trait Implementations§

Source§

impl IsApproxEqual<f32> for Asserter<f32>

Source§

fn is_approx_equal(&self, expected_value: f32, delta: f32)

Source§

impl IsApproxEqual<f64> for Asserter<f64>

Source§

fn is_approx_equal(&self, expected_value: f64, delta: f64)

Source§

impl IsApproxEqual<i128> for Asserter<i128>

Source§

fn is_approx_equal(&self, expected: i128, delta: i128)

Source§

impl IsApproxEqual<i16> for Asserter<i16>

Source§

fn is_approx_equal(&self, expected: i16, delta: i16)

Source§

impl IsApproxEqual<i32> for Asserter<i32>

Source§

fn is_approx_equal(&self, expected: i32, delta: i32)

Source§

impl IsApproxEqual<i64> for Asserter<i64>

Source§

fn is_approx_equal(&self, expected: i64, delta: i64)

Source§

impl IsApproxEqual<i8> for Asserter<i8>

Source§

fn is_approx_equal(&self, expected: i8, delta: i8)

Source§

impl IsApproxEqual<u128> for Asserter<u128>

Source§

fn is_approx_equal(&self, expected: u128, delta: u128)

Source§

impl IsApproxEqual<u16> for Asserter<u16>

Source§

fn is_approx_equal(&self, expected: u16, delta: u16)

Source§

impl IsApproxEqual<u32> for Asserter<u32>

Source§

fn is_approx_equal(&self, expected: u32, delta: u32)

Source§

impl IsApproxEqual<u64> for Asserter<u64>

Source§

fn is_approx_equal(&self, expected: u64, delta: u64)

Source§

impl IsApproxEqual<u8> for Asserter<u8>

Source§

fn is_approx_equal(&self, expected: u8, delta: u8)

Source§

impl<T, K> IteratorAssertions<T> for Asserter<K>
where T: Debug + PartialEq, K: IntoIterator<Item = T> + Clone,

Source§

fn contains(&self, expected_value: T)

Checks if the iterator contains the specified element
Source§

fn contains_all(&self, expected_values: &[T])

Checks if the iterator contains the specified elements
Source§

fn has_count(&self, expected_count: usize)

Checks if the iterator has the specified count
Source§

fn does_not_contain_any(&self, not_expected_values: &[T])

Checks if the iterator does not contain any of the specified elements
Source§

fn is_empty(&self)

Checks if the iterator is empty
Source§

fn is_not_empty(&self)

Checks if the iterator is not empty
Source§

impl<T, K> IteratorSatisfiesAssertion<T> for Asserter<K>
where K: IntoIterator<Item = T> + Clone,

Source§

fn satisfies_respectively(&self, asserter: Vec<Box<dyn Fn(&T)>>)

Checks if the elements of the iterators satisfies the specified assertions Read more
Source§

impl<T> StrAssertions<T> for Asserter<T>
where T: Into<String> + Clone,

Source§

fn contains(&self, expected: &str)

Source§

fn starts_with(&self, expected_start: &str)

Source§

fn ends_with(&self, expected_end: &str)

Source§

fn is_empty(&self)

Source§

fn is_not_empty(&self)

Source§

fn has_length(&self, expected_length: usize)

Source§

fn contains_all(&self, args: &[&str])

Source§

fn contains_any(&self, args: &[&str])

Auto Trait Implementations§

§

impl<T> Freeze for Asserter<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Asserter<T>
where T: RefUnwindSafe,

§

impl<T> Send for Asserter<T>
where T: Send,

§

impl<T> Sync for Asserter<T>
where T: Sync,

§

impl<T> Unpin for Asserter<T>
where T: Unpin,

§

impl<T> UnwindSafe for Asserter<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.