diff --git a/src/core/types/parse_mode.rs b/src/core/types/parse_mode.rs index a1e7a0ca..f50d1fc4 100644 --- a/src/core/types/parse_mode.rs +++ b/src/core/types/parse_mode.rs @@ -68,3 +68,25 @@ pub enum ParseMode { HTML, Markdown, } + + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn html_serialization() { + let expected_json = String::from(r#""HTML""#); + let actual_json = serde_json::to_string(&ParseMode::HTML).unwrap(); + + assert_eq!(expected_json, actual_json) + } + + #[test] + fn markdown_serialization() { + let expected_json = String::from(r#""Markdown""#); + let actual_json = serde_json::to_string(&ParseMode::Markdown).unwrap(); + + assert_eq!(expected_json, actual_json) + } +}