1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use std::collections::HashMap;
#[derive(Debug)]
pub struct TestCaseResult {
title: String,
description: String,
did_pass: bool,
metadata: HashMap<String, String>,
}
impl TestCaseResult {
#[allow(missing_docs)]
pub fn new(title: String, description: String, did_pass: bool) -> Self {
TestCaseResult {
title,
description,
did_pass,
metadata: HashMap::new(),
}
}
pub fn title(&self) -> &str {
&self.title
}
pub fn description(&self) -> &str {
&self.description
}
pub fn insert_metadata(&mut self, key: String, value: String) -> Option<String> {
self.metadata.insert(key, value)
}
pub fn did_pass(&self) -> bool {
self.did_pass
}
pub fn metadata(&self) -> &HashMap<String, String> {
&self.metadata
}
}