Struct CaseGroup

Source
pub struct CaseGroup<T, G, P> { /* private fields */ }
Expand description

A easy to use test case collection struct that also provide functions for simple test case creation.

Implementations§

Source§

impl<T, G, P> CaseGroup<T, G, P>

Source

pub fn new() -> CaseGroup<T, G, P>

Create a new CaseGroup instance.

Source

pub fn add(&mut self, case: Case<T, G, P>)

Add existing test case instance to the collection.

Note: an additional index value will be set by calling this method.

Source

pub fn all(self) -> Vec<Case<T, G, P>>

Get all test cases within current test case collection.

Source§

impl<G, P> CaseGroup<String, G, P>
where P: PartialEq + Debug, G: PartialEq + Debug,

Implement two handy methods on CaseGroup<String, G, P> struct.

Source

pub fn create(&mut self, ipt: &str, exp: Vec<G>)

Create a new test case (no input parameters) matching &str and other generic types.

§Argument
  • ipt - this argument is set to &str to simplify method calls.
  • exp - expected values in Vec<G> form.
Source

pub fn create_param(&mut self, ipt: &str, exp: Vec<G>, params: Vec<P>)

Create a new test case (with input parameters) matching &str and other generic types.

§Argument
  • ipt - this argument is set to &str to simplify method calls.
  • exp - expected values in Vec<G> form.
  • params - expected values in Vec<P> form.
Source

pub fn create_multi(&mut self, ipts: Vec<&str>, exp: Vec<G>)

Create a new test case (no input parameters but multiple inputs) matching &str and other generic types.

§Argument
  • ipts - this argument is set to &str to simplify method calls.
  • exp - expected values in Vec<G> form.
Source

pub fn create_param_multi( &mut self, ipts: Vec<&str>, exp: Vec<G>, params: Vec<P>, )

Create a new test case (with input parameters and multiple inputs) matching &str and other generic types.

§Argument
  • ipts - this argument is set to &str to simplify method calls.
  • exp - expected values in Vec<G> form.
  • params - expected values in Vec<P> form.
Source§

impl CaseGroup<i32, i32, i32>

Implement two handy methods on CaseGroup struct.

Source

pub fn create(&mut self, ipt: i32, exp: Vec<i32>)

Create a new test case (no input parameters) matching selected generic types.

Source

pub fn create_param(&mut self, ipt: i32, exp: Vec<i32>, params: Vec<i32>)

Create a new test case (with input parameters) matching selected generic types.

Source

pub fn create_multi(&mut self, ipts: Vec<i32>, exp: Vec<i32>)

Create a new test case (no input parameters but multi-inputs) matching selected generic types.

Source

pub fn create_param_multi( &mut self, ipts: Vec<i32>, exp: Vec<i32>, params: Vec<i32>, )

Create a new test case (with input parameters and multi-inputs) matching selected generic types.

Source§

impl CaseGroup<i32, String, i32>

Implement two handy methods on CaseGroup struct.

Source

pub fn create(&mut self, ipt: i32, exp: Vec<String>)

Create a new test case (no input parameters) matching selected generic types.

Source

pub fn create_param(&mut self, ipt: i32, exp: Vec<String>, params: Vec<i32>)

Create a new test case (with input parameters) matching selected generic types.

Source

pub fn create_multi(&mut self, ipts: Vec<i32>, exp: Vec<String>)

Create a new test case (no input parameters but multi-inputs) matching selected generic types.

Source

pub fn create_param_multi( &mut self, ipts: Vec<i32>, exp: Vec<String>, params: Vec<i32>, )

Create a new test case (with input parameters and multi-inputs) matching selected generic types.

Source§

impl CaseGroup<i32, bool, i32>

Implement two handy methods on CaseGroup struct.

Source

pub fn create(&mut self, ipt: i32, exp: Vec<bool>)

Create a new test case (no input parameters) matching selected generic types.

Source

pub fn create_param(&mut self, ipt: i32, exp: Vec<bool>, params: Vec<i32>)

Create a new test case (with input parameters) matching selected generic types.

Source

pub fn create_multi(&mut self, ipts: Vec<i32>, exp: Vec<bool>)

Create a new test case (no input parameters but multi-inputs) matching selected generic types.

Source

pub fn create_param_multi( &mut self, ipts: Vec<i32>, exp: Vec<bool>, params: Vec<i32>, )

Create a new test case (with input parameters and multi-inputs) matching selected generic types.

Source§

impl CaseGroup<Vec<i32>, i32, i32>

Implement two handy methods on CaseGroup struct.

Source

pub fn create(&mut self, ipt: Vec<i32>, exp: Vec<i32>)

Create a new test case (no input parameters) matching selected generic types.

Source

pub fn create_param(&mut self, ipt: Vec<i32>, exp: Vec<i32>, params: Vec<i32>)

Create a new test case (with input parameters) matching selected generic types.

Source

pub fn create_multi(&mut self, ipts: Vec<Vec<i32>>, exp: Vec<i32>)

Create a new test case (no input parameters but multi-inputs) matching selected generic types.

Source

pub fn create_param_multi( &mut self, ipts: Vec<Vec<i32>>, exp: Vec<i32>, params: Vec<i32>, )

Create a new test case (with input parameters and multi-inputs) matching selected generic types.

Source§

impl CaseGroup<Vec<i32>, Vec<Vec<i32>>, i32>

Implement two handy methods on CaseGroup struct.

Source

pub fn create(&mut self, ipt: Vec<i32>, exp: Vec<Vec<Vec<i32>>>)

Create a new test case (no input parameters) matching selected generic types.

Source

pub fn create_param( &mut self, ipt: Vec<i32>, exp: Vec<Vec<Vec<i32>>>, params: Vec<i32>, )

Create a new test case (with input parameters) matching selected generic types.

Source

pub fn create_multi(&mut self, ipts: Vec<Vec<i32>>, exp: Vec<Vec<Vec<i32>>>)

Create a new test case (no input parameters but multi-inputs) matching selected generic types.

Source

pub fn create_param_multi( &mut self, ipts: Vec<Vec<i32>>, exp: Vec<Vec<Vec<i32>>>, params: Vec<i32>, )

Create a new test case (with input parameters and multi-inputs) matching selected generic types.

Auto Trait Implementations§

§

impl<T, G, P> Freeze for CaseGroup<T, G, P>

§

impl<T, G, P> RefUnwindSafe for CaseGroup<T, G, P>

§

impl<T, G, P> Send for CaseGroup<T, G, P>
where T: Send, P: Send, G: Send,

§

impl<T, G, P> Sync for CaseGroup<T, G, P>
where T: Sync, P: Sync, G: Sync,

§

impl<T, G, P> Unpin for CaseGroup<T, G, P>
where T: Unpin, P: Unpin, G: Unpin,

§

impl<T, G, P> UnwindSafe for CaseGroup<T, G, P>
where T: UnwindSafe, P: UnwindSafe, G: 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.