pub struct TestCase {
pub name: String,
pub time: Duration,
pub result: TestResult,
pub classname: Option<String>,
pub filepath: Option<String>,
pub system_out: Option<String>,
pub system_err: Option<String>,
}Expand description
One single test case
Fields§
§name: String§time: Duration§result: TestResult§classname: Option<String>§filepath: Option<String>§system_out: Option<String>§system_err: Option<String>Implementations§
Source§impl TestCase
Auto-generated by derive_getters::Getters.
impl TestCase
Auto-generated by derive_getters::Getters.
Sourcepub fn result(&self) -> &TestResult
pub fn result(&self) -> &TestResult
Get field result from instance of TestCase.
Sourcepub fn system_out(&self) -> &Option<String>
pub fn system_out(&self) -> &Option<String>
Get field system_out from instance of TestCase.
Sourcepub fn system_err(&self) -> &Option<String>
pub fn system_err(&self) -> &Option<String>
Get field system_err from instance of TestCase.
Source§impl TestCase
impl TestCase
Sourcepub fn set_classname(&mut self, classname: &str)
pub fn set_classname(&mut self, classname: &str)
Set the classname for the TestCase
Sourcepub fn set_filepath(&mut self, filepath: &str)
pub fn set_filepath(&mut self, filepath: &str)
Set the file for the TestCase
Sourcepub fn set_system_out(&mut self, system_out: &str)
pub fn set_system_out(&mut self, system_out: &str)
Set the system_out for the TestCase
Sourcepub fn set_system_err(&mut self, system_err: &str)
pub fn set_system_err(&mut self, system_err: &str)
Set the system_err for the TestCase
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if a TestCase is successful
Sourcepub fn error(name: &str, time: Duration, type_: &str, message: &str) -> Self
pub fn error(name: &str, time: Duration, type_: &str, message: &str) -> Self
Creates a new erroneous TestCase
An erroneous TestCase is one that encountered an unexpected error condition.
Sourcepub fn failure(name: &str, time: Duration, type_: &str, message: &str) -> Self
pub fn failure(name: &str, time: Duration, type_: &str, message: &str) -> Self
Creates a new failed TestCase
A failed TestCase is one where an explicit assertion failed
Sourcepub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
Check if a TestCase failed
Sourcepub fn skipped(name: &str) -> Self
pub fn skipped(name: &str) -> Self
Create a new ignored TestCase
An ignored TestCase is one where an ignored or skipped
Sourcepub fn skipped_with_cause(name: &str, type_: &str, message: &str) -> Self
pub fn skipped_with_cause(name: &str, type_: &str, message: &str) -> Self
Create a new ignored TestCase with an ignore cause
An ignored TestCase is one where an ignored or skipped
Sourcepub fn is_skipped(&self) -> bool
pub fn is_skipped(&self) -> bool
Check if a TestCase ignored