Struct junit_report::TestCase
source · [−]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: Stringtime: Durationresult: TestResultclassname: Option<String>filepath: Option<String>system_out: Option<String>system_err: Option<String>Implementations
sourceimpl TestCase
impl TestCase
pub fn name(&self) -> &String
pub fn time(&self) -> &Duration
pub fn result(&self) -> &TestResult
pub fn classname(&self) -> &Option<String>
pub fn filepath(&self) -> &Option<String>
pub fn system_out(&self) -> &Option<String>
pub fn system_err(&self) -> &Option<String>
sourceimpl 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 is_skipped(&self) -> bool
pub fn is_skipped(&self) -> bool
Check if a TestCase ignored
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TestCase
impl Send for TestCase
impl Sync for TestCase
impl Unpin for TestCase
impl UnwindSafe for TestCase
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more