argumentation_schemes/
critical.rs1use crate::types::Challenge;
4
5#[derive(Debug, Clone, PartialEq, Eq)]
11pub struct CriticalQuestion {
12 pub number: u32,
14 pub text: String,
16 pub challenge: Challenge,
18}
19
20impl CriticalQuestion {
21 pub fn new(number: u32, text: impl Into<String>, challenge: Challenge) -> Self {
23 Self {
24 number,
25 text: text.into(),
26 challenge,
27 }
28 }
29}
30
31#[cfg(test)]
32mod tests {
33 use super::*;
34
35 #[test]
36 fn critical_question_stores_challenge() {
37 let cq = CriticalQuestion::new(
38 1,
39 "Is ?expert really an expert in ?domain?",
40 Challenge::PremiseTruth("expert".into()),
41 );
42 assert_eq!(cq.number, 1);
43 assert!(cq.text.contains("?expert"));
44 assert!(matches!(cq.challenge, Challenge::PremiseTruth(_)));
45 }
46}