pub use self::test_case_result::*;
mod test_case_result;
#[derive(Debug)]
pub struct TestCaseResults {
suite_title: String,
suite_description: String,
results: Vec<TestCaseResult>,
}
impl TestCaseResults {
pub fn new(
suite_title: String,
suite_description: String,
results: Vec<TestCaseResult>,
) -> Self {
assert!(results.len() > 0);
TestCaseResults {
suite_title,
suite_description,
results,
}
}
pub fn suite_title(&self) -> &String {
&self.suite_title
}
pub fn suite_description(&self) -> &String {
&self.suite_description
}
pub fn results(&self) -> &Vec<TestCaseResult> {
&self.results
}
pub fn did_pass(&self) -> bool {
self.results.iter().all(|r| r.did_pass())
}
pub fn assert_did_pass(&self) {
assert!(self.did_pass());
}
}