[][src]Struct serial_unit_testing::tests::test_case::TestCase

pub struct TestCase {
    pub settings: TestCaseSettings,
    pub input_format: TextFormat,
    pub output_format: TextFormat,
    // some fields omitted
}

Test representing a check on the serial.

Fields

settings: TestCaseSettings

Settings to use for the test.

input_format: TextFormat

Text format of the input send to the serial.

output_format: TextFormat

Text format of the response received by the serial.

Methods

impl TestCase[src]

pub fn new(name: String, input: String, output: String) -> TestCase[src]

Create a new test.

pub fn run(&mut self, serial: &mut Serial) -> Result<bool, String>[src]

Execute the test on given serial port.

After running the test response and successful are set if no error occurred.

pub fn is_successful(&self) -> Option<bool>[src]

Check if the test was successful.

If the test was not run before None will be returned.

pub fn error(&self) -> Option<String>[src]

Get the error from running the test.

If the test was not run before or no error occurred None will be returned.

Trait Implementations

impl ToString for TestCase[src]

impl Debug for TestCase[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]