use crate::eval::monadic_architecture::MonadicEvaluationResult;
use crate::diagnostics::Result;
use super::{TestScenario, TestAssertion};
use std::collections::HashMap;
#[derive(Debug)]
pub struct TestResult {
pub scenario: TestScenario,
pub execution_result: Result<MonadicEvaluationResult>,
pub execution_time_ms: u64,
pub assertions_passed: Vec<TestAssertion>,
pub assertions_failed: Vec<TestAssertion>,
pub mock_call_counts: HashMap<String, usize>,
}
impl TestResult {
pub fn passed(&self) -> bool {
self.assertions_failed.is_empty() && self.execution_result.is_ok()
}
pub fn summary(&self) -> String {
format!(
"Test '{}': {} ({}ms, {}/{} assertions passed)",
self.scenario.name,
if self.passed() { "PASSED" } else { "FAILED" },
self.execution_time_ms,
self.assertions_passed.len(),
self.assertions_passed.len() + self.assertions_failed.len()
)
}
}